How to call a report designer at runtime

How to call a report designer at runtime

Crystal Report is built in object of VS. You can find it from toolbar. Drag Crystal report viewer and drop it on your form. Crystal Report viewer is container of Crystal Report, in which you can open your report(*.rpt).


 Following is sample code for Crystal Report...  
 /* Init. Crystal Report object*/  
 CrystalReport1 rptReport = new CrystalReport1();  
 /* Declaration and assignment of datatable as report source for report object*/  
 DataTable dtTemp = new DataTable();  
 rptReport.SetDataSource(dtTemp);  
 /*Init. of report file to Reportviewer to view report*/  
 crystalReportViewer1.ReportSource = rptReport;  

This will work with Crystal Report. Data report is also there but Crystal report is more professional in compare to Data report