How to display Crystall Reports.
-
How can I display a Crystal Report in VB.Net 2005. I have added a report by clicking on the Add\New Item\Crystall Report on the Solution Explorer window. And I have also desined the report and the data is getting fetched in the design mode. Also how can I change the connection string property during runtime ? Please Help, I am new to Crystall Reports. Thanks in advance.
Sekhar :)
-
How can I display a Crystal Report in VB.Net 2005. I have added a report by clicking on the Add\New Item\Crystall Report on the Solution Explorer window. And I have also desined the report and the data is getting fetched in the design mode. Also how can I change the connection string property during runtime ? Please Help, I am new to Crystall Reports. Thanks in advance.
Sekhar :)
I assume you've got an db-view connected to the report. Normaly you don't have to provide the connection string anymore (it's hardwired into the generated report-class), if not you can allways use the DataSource-property of the report. To show the report you need the CrystalReportViewer-Control (well it should be named something like this). Just put it on a form and set the ReportSource - property of the control to an instance of your report-class (same name as your report - get's generated - sometimes CR has problems with namespaces so look into the object browser) - that's it. If you just want to print the report you can use the print-functions of the report without the viewer (same for exports - great for PDFs and so on). Bye the way: I normaly use CR with datasets (so I greate an dataadapter for the dataview I like to see, create the CR with this dataset and then do something like:
dim report as new CrystalReport1 report.SetDataSource(ctype(dataadapter.GetData(),DataTable)) crviewer1.ReportSource = report
This way I can pass parameters for the view in GetData (if I have any) - filtering in CR tended to be done on the client (i.e. all the data of the table/view was passed to the report and THEN filtered :wtf: - don't know if this is still the case but I use the above approach anyway ... ) -
How can I display a Crystal Report in VB.Net 2005. I have added a report by clicking on the Add\New Item\Crystall Report on the Solution Explorer window. And I have also desined the report and the data is getting fetched in the design mode. Also how can I change the connection string property during runtime ? Please Help, I am new to Crystall Reports. Thanks in advance.
Sekhar :)
Hi, On your Win Form add crystalreportviewer and reportdocument from the Toolbox. and in code just add following 2 lines : reportdocument.SetDataSource(dataset1.Tables(0)) crystalreportviewer.ReportSource = reportdocument where your dataset contains the report data to be displyed.
Regards, Ujjaval Modi
-
Hi, On your Win Form add crystalreportviewer and reportdocument from the Toolbox. and in code just add following 2 lines : reportdocument.SetDataSource(dataset1.Tables(0)) crystalreportviewer.ReportSource = reportdocument where your dataset contains the report data to be displyed.
Regards, Ujjaval Modi
There is no Report Document in the ToolBox. Please can u tell me how to add Report Document in the ToolBox....