1.6. Using the Crystal Reports Viewer

Now that you have a report, you need to allow a user to view it. So far, you've seen how to preview the report in the Visual Studio Designer, but the user of your application needs a way to view the report. Crystal Reports comes with a viewer control that will do all the heavy lifting, and it is a relatively trivial task to display your report to the user. Follow these steps to change the Default page to display the Employee report you've just created.

  1. Open the Default.aspx page in Design mode.

  2. From the toolbar, drag a CrystalReportsViewer control onto the Default.aspx page.

  3. Double-click on the Default page to create the Page_Load event in the code-behind page, and enter the following code:

    protected void Page_Load(object ...

Get Integrating Crystal Reports into an ASP.NET Application now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.