 |

|
how can i print my crystal report using c#??
|
|
|
|

|
hi,
when i am using
rptdoc.PrintToPrinter(1, false, 0, 0);
in c#
getting error: No printer installed
please can any one help me
thanks in advance
|
|
|
|

|
getting idea but not too much clear cut
|
|
|
|

|
hi, using c#, to export crystal report into excel; how to protect the excel with password?
below is my code for exporting all pages
ReportDocument objRDoc = new ReportDocument();
objRDoc.Load("rpt path");
ExportOptions CrExportOptions ;
DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
ExcelFormatOptions CrFormatTypeOptions = new ExcelFormatOptions();
CrDiskFileDestinationOptions.DiskFileName = "c:\\1111.xls";
CrExportOptions = objRDoc.ExportOptions;
CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
CrExportOptions.ExportFormatType = ExportFormatType.Excel;
CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions.DiskFileName;
CrExportOptions.FormatOptions = CrFormatTypeOptions;
objRDoc.Export();
|
|
|
|

|
hi, using c#, itext how to export crystal report from 2nd page onwards?
below is my code for exporting all pages
ReportDocument objRDoc = new ReportDocument();
objRDoc.Load("rpt path");
ExportOptions expo = objRDoc.ExportOptions;
expo.ExportDestinationType = ExportDestinationType.DiskFile;
expo.ExportFormatType = ExportFormatType.PortableDocFormat;
DiskFileDestinationOptions objDfDopt.DiskFileName = "pdf path";
expo.DestinationOptions = objDfDopt;
objRDoc.Export();
objRDoc.Refresh();
modified 16-Feb-12 22:13pm.
|
|
|
|
|
|
|

|
In the Page_Load event, you could write:
string fileName = "reportName";
Response.Clear();
crReportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, fileName);
Response.Flush();
Response.End();
I am using Visual Studio 2005 SP1
|
|
|
|

|
I am trying to print a crystal report in ActiveX mode from Visual Studio.NET. Everything works fine on my development machine. When I click on the print icon on the toolbar, it shows list of all the printers on the local machine.
But when I copy all the files to the deployment server and access that site from the user machine and try to print the report , when I click on the print icon on the toolbar I see an empty dialog box. The list of local printers does not appear.
This is for crystal reports XI and IE 7.
Why is the crystal reports print control coming as an empty white box?
Can anyone please help? I am new to asp.net and I have spent more than few days trying to find solution on the internet.
Thanks,
Kruti
|
|
|
|

|
Hi, i'm using the sentence obj.SetDataBaseLogOn ( name, pwd, bd, server )
but i can´t connect and the report is waiting all the time to connect, but fails.
Do you know another form?
greetings.
Jorge
|
|
|
|

|
I´m trying to print a report in a web page with c#, but i´m not capable of it, and i made a test with this code, but in c#, and gives me this error:Invalid report file path.
someone can help me???
my email is mundodasaves@live.com
|
|
|
|
|

|
hi sachin
this is heena again
well first of all i will explain you what i am doing.
i have ceated a website in which i am passing dataset in my code to crystal report and then try to publish that website on other server.
well till here its fine.
the whole things works fine on my desktop but when i try to open it on internet explorer --- giving path of my server ---after publish it on the server , it gives me login failed error.
i entered your code
rptc.SetDatabaseLogon("userid", "password").
please help me out.
its urgent
if you want i can send you the actual code on your email address.
heena patel
|
|
|
|

|
hi sachin
i am heena
i tried to creat an object of crystalreport file as you have used in your code
"dim rpt as new crystalreport2"
but didnt work.
i dont know what i am missing but it gives me error " Crystalreport is not defined"
can you please explain me how can i create this
Thank you
heena patel
|
|
|
|

|
Dear,
I've copied your sample code into my application. But I have some additional section on my report, I need some Group Sectin for my report.
I try to add new crystal report object into my web application, but i did not find the class which is auto generated code for the crystal report. I copy the CrystalReport2.vb from your sample code downloaded file, when I run, application show error like this:
Unable to find the report in the manifest resources. Please build the project, and try again.
And tried to modify the class but still error, but once the page could load, but the report won't be displayed.
Then when I click the Export button, there is an error which said that application cannot find the report. Like the error above.
Do you have any idea for this problem??
Thank you.
B3 Y0uR 53lf
|
|
|
|
|

|
i have 5 pages in my report.on exporting it in pdf format the data is expanded to 12 pages.i want the same number of pages in pdf format as in report. how can i?
hhhhhhhhhh
|
|
|
|

|
I used the above code to convert a crystal report that displayed a list of values into a pdf file, which it did, but the problem is that every record in that list got displayed on its own page in the generated pdf document... Any ideas on how I could actually display the whole list on 2 subsequent pages, and not have an 85-page document for 85 records?
Thanks in advance.
GR
|
|
|
|

|
What makes this article really good.b'coz in some books its is suggested to use browser print button for printting crystal report..!
to all programmers who rely on web for development
|
|
|
|

|
hi sachin
i have created a project using your codes. when i execute it is working fine but when i click on print button it is giving following error :
Error in File D:\DOCUME~1\ASUS4\ASPNET\LOCALS~1\Temp\temp_d4119936-2d4c-4258-8ac5-21b9abdc410f.rpt: Request cancelled by the user.
can u please let me know the reason for the same.
ashish jain
|
|
|
|

|
Hi,
I need to export a crstal report document *.prn programmatically.
I have only seen predefined export types.
Would anybody be able to let me know if this is possible for me to do. If so, how?!?!
This is quite urgent. I've spent the whoel day surfing the web for an answer.
thanks!
Nosheen
|
|
|
|

|
It is very very Good Example to Exporting data in different format..
asdfsdf dfasfs
|
|
|
|

|
Hi there people. I tried this code but at the end a nasty error like "Thread was being aborted" comes up. Can anybody tell me what can i do to solve this.
thks in advance.
marquito
|
|
|
|

|
Hi
I need your help to build crystal reports in ASP.Net. I used your code which was given in Codeproject.com.
But when I export the data in pdf or anything I am not able to view the aspx page properly. I am getting a blank screen.
Can anyone help me out to resolve this problem.
|
|
|
|

|
Im using a vb.net for a web application and i use the code but there is a problem in "System.Diagnostics.DebuggerStepThrough()"
it says that: "Attribute specifier is not complete statement. Use line continuation to apply the attribute to the folling statement"
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
System.Diagnostics.DebuggerStepThrough()
Private Sub InitializeComponent()
Please help me with this one....
|
|
|
|

|
Hi All,
I'm using crystal report with ASP.Net. My backend database is MSACCESS. I'm using PUSH method for sending data to crystal report. When i try to print report, it Gives me error "Logon Failed"
crReportDocument.SetDatabaseLogon("Admin", "")
I set this for solving error, but its not working.
There is no username or password set for databse
Plz help
Thanks
Swati
|
|
|
|

|
its really a good artical but i want to export my crystal reports to XML format is it Possible
yashkant
|
|
|
|

|
I have the problem with parameter's. I using CR Viewer 11. The report (made by CR 11) has 2 multivalue parameter and 1 rangevalue parameter (Date). On the export (code from this article) I having error "Missing parameter values." And the error occured in in code "stream = (System.IO.MemoryStream)this.reportDoc.ExportToStream(exportFormatType);"
Do i must appropriate to all parameters any values before export??? Or not?
How work with range parameter's value?
Please help me!!!
|
|
|
|

|
I had unzipped the project in the foleder C:\InetPub\wwwroot\crCodes. when I press F5 to run/Debug project. "It displays a message the project is not configured for debugging". how can I run this project.
Skan
|
|
|
|

|
i used the following code and the Logon error occurred,
rptTest.SetDatabaseLogon(Application["USERID"].ToString(),Application["PASSWORD"].ToString(),Application["SERVER"].ToString(),Application["DATABASE"].ToString());
with rptTest is a Cystal Report file. Please help me. Thanks.
|
|
|
|

|
dear sir,
it show error login failure.
CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.
i didnt yet use crystal report.
i download the demo code and run.
where i fill this , how i know which table field r used for filling report?
i change only
crReportDocument.SetDatabaseLogon("sa", "sa", "USER", "Accounts")
help me plz
with regards
vipin
vipin
|
|
|
|

|
Dear sir!
Thank you very much for your free code.
I have completed to print crystalReport with local printer. But i could not print with the printer which was shared on LAN.
Although I have assigned(at Button1 click event):
crReportDocument.SetDatabaseLogon("sa", "sql", "10.149.50.1", "Northwind")
crReportDocument.PrintOptions.PrinterName = "\\10.149.50.1\Canon LBP-800"
crReportDocument.PrintToPrinter(1, False, 0, 0)
pls, help me.
I'm looking forward your help!
Thanks.
|
|
|
|

|
Hi, i have a problem when i try to export the report to ms word, when i press the button, i get a form that ask me if i want to save or open a aspx page.
How can i do to correct this problem.
I have a problem to print the report to, the web server doesn't respond.
Thanks.
|
|
|
|

|
Hi There,
I would just like to ask if I really need to add this line:
rptMRB.SetDatabaseLogon("USER", "PWD", "SERVER", "DBASE")
I have created a dsReport.xsd, then fill that dataset by data I pulled from my SQL server.
Here's my code:
Dim ds As New dsReport ' this is my .xsd object
Dim rptMRB As New rptMRB ' this is my .rpt embedded in my application
FillDataset() ' a procedure to fill the .xsd
rptMRB.SetDataSource(ds)
crvMRB.ReportSource = rptMRB
crvMRB.DisplayGroupTree = False
exportPDF ' a procedure to export in PDF
This code works in my local PC, but when I deploy it in the main server, Logon Failure occurs.
I don't know what else to do. I tried copying the CrystalDecisions DLL needed in the C:/Program Files/Common Files/Crystal Decisions/1.1/..., but still I get the error.
If you have some ideas how to solve this, I would appreciate your suggestions.
Thanks a lot,
Lilay
|
|
|
|

|
Hi Everybody !
I have a report that i use to export PDF file. when i have not changed a server i do well but when i change the server it did not work right,It just show me the old data (not refresh). How do i solve this problem.
This is my code :
Dim CrReport As New _
CrystalDecisions.CrystalReports.Engine.ReportDocument
CrReport.Load("Myreport.rpt")
CrReport.SetDatabaseLogon("myuser", "Mypass", "Myserver", "Mydatabase")
CrReport.Refresh()
Dim CrExportOptions As CrystalDecisions.Shared.ExportOptions
Dim CrDiskFileDestinationOptions As New _
CrystalDecisions.Shared.DiskFileDestinationOptions
Dim CrFormatTypeOptions As New _
CrystalDecisions.Shared.PdfRtfWordFormatOptions
CrDiskFileDestinationOptions.DiskFileName = "Myreport.dpf"
CrFormatTypeOptions.FirstPageNumber = 1
CrFormatTypeOptions.LastPageNumber = 1000
CrFormatTypeOptions.UsePageRange = True
CrExportOptions = CrReport.ExportOptions
With CrExportOptions
.ExportDestinationType = _
CrystalDecisions.Shared.ExportDestinationType.DiskFile
.ExportFormatType = _
CrystalDecisions.Shared.ExportFormatType.PortableDocFormat
.DestinationOptions = CrDiskFileDestinationOptions
.FormatOptions = CrFormatTypeOptions
End With
CrReport.Export()
|
|
|
|

|
hi, I use your method in asp.net(cs) for printing and exporting.but I get errors like Request cancelled by the user for printing and cannot explicitly convert System.IO.Stream to System.IO.MemoryStream please reply me soon
Regards
selva
Thanks in Advance
|
|
|
|
|

|
Hi,All
I have web Application(ASP.NET by Visual Studio.NET) and I want to printing report ,I have form for search and search found It's show in datagrid I want to resultset in datagid can show in format of Cystalreport by cystalreportviewer control but I can't bring resultset show report
Please introduce me
Thanks
Nisarat
|
|
|
|

|
Hi let me know where we are giving data source to the report
|
|
|
|

|
Hi i am still receiving loginfailed error message can any body explain what exactly i have to do with this
"crReportDocument.SetDatabaseLogon("username", "password", "sql-server", "database")"
and where is the table name here
|
|
|
|

|
Hi There,
Thanks for such nice piece of code. It worked for me without any problems. But when i tried to print, i got the following error.
Exception Details: CrystalDecisions.CrystalReports.Engine.PrintException: Error in File C:\WINDOWS\TEMP\temp_01173742-8c7f-40e3-bca0-a71edab0e310.rpt: No default printer.
I have the default printer set but why do i get that error. I have made no changes to your code expect for the database connections part.
Thanks
|
|
|
|

|
I need export my report to *.txt file,
please, helpme
I think is with the option :
CrystalDecisions.Shared.ExportFormatType.NoFormat
thanks.
|
|
|
|

|
i follow the sample, but when i click on the button to export report into excel...it print out all alien words on the screen..
pls advice, anywhere i did wrong?
|
|
|
|

|
I had no trouble running this project. There are a few minor fixes needed, but it is a good start. What would you expect for free.
THX
Sachin
|
|
|
|

|
I tried to use this code but when did the build on my project it failed on ExportToStream saying it was not a member of the report file class.
|
|
|
|

|
What if i wnt to pass 2 o more values to a parameter...
|
|
|
|

|
"USER", "PASSWORD", "SQL-SERVER", "DATABASE". what is this parameters. are they our sql connection user name and pass,aren't they? if this is true. I write my user name "sa" my pass. but still I take LOGON FAILED error. What must I do. My second question is what is the Database name in this sample. have we this database.
|
|
|
|
|

|
Your zip file is corru[ted and so you have NO sample code!
Bill SerGio
|
|
|
|
 |