Creating a Crystal Report Viewer Control - Crystal Report in ASP.NET
Sunday, February 24, 2008 5:36:10 PM
In previous post, You learn a way to create Crystal Report in ASP.NET. This post discripted a way to binding a crystal report control and CrystalReportViewer.
1) Drag and drop the "Crystal Report Viewer>" from the web forms tool box on to the .aspx page
2) Open the properties window for the Crystal Report Viewer control.
3) Click on the [...] next to the "Data Binding" Property and bring up the data binding pop-up window
4) Select "Report Source".
5) Select the "Custom Binding Expression" radio button, on the right side bottom of the window and specify the sample .rpt filename and path as shown in the fig.

6) You should be able to see the Crystal Report Viewer showing you a preview of actual report file using some dummy data and this completes the inserting of the Crystal Report Viewer controls and setting its properties.
Note: In the previous example, the CrystalReportViewer control was able to directly load the actual data during design time itself as the report was saved with the data. In this case, it will not display the data during design time as it not saved with the data - instead it will show up with dummy data during design time and will fetch the proper data only at run time.
7) Call the Databind method on the Page Load Event of the Code Behind file (.aspx.vb). Build and run your .aspx page. The output would look like this.






