Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

1.03 ASP.NET Preview

Previewing with ASP.NET

Previewing a report with ASP.NET requires adding a CrystalReportViewer control to the web page and attaching it to a CrystalReportSource control. Create a new web project and open the default web page in design mode. Add a CrystalReportViewer control to it. The viewer is located in the Reporting tab near the end of the Toolbox. Once you add it to the form you will see a medium sized rectangle on the web page.



Figure 1-8. The ASP.NET report viewer control.

Notice that the web viewer control looks totally different than the Windows viewer control. The web viewer is simply a placeholder for where the report will be displayed.

Click on the viewer control and notice that it has a small arrow in the top right corner. Click on this to open a list of smart tasks. This is shown in Figure 1-8.



Figure 1-9. The ReportDocument dialog box.

Click the drop-down box for Choose Report Source and select . This opens the Create Report Source dialog box. It lets you specify a name for the report source and pick the report to use. Click the botton drop-down box and choose the CrystalReport.rpt report.


Click the OK button to create the report source control and link it to the viewer control. This automatically previews the report in design mode of your ASP.NET application.

Run the web application and you’ll see the Employee List report automatically previewed when the page opens.



Figure 1-10. The Employee List report shown in an ASP.NET application.