Using the Windows Forms Report Viewer

Now that you have a report ready to run and you're familiar with the reports designer, you can create a form to actually view your report.

The first step is to add a new form to your solution by right-clicking the project name in the Solution Explorer and selecting Add, Add Windows Form from the contextual menu. You can leave the default Form1.vb or Form1.cs name.

Next, in the Toolbox, scroll down in the Windows Forms tab until you see the CrystalReportViewer control. Drag it onto your form, and set the Dock property to Fill so that it resizes with the form. Your form should look something like Figure 18.18.

Figure 18.18. Form1 after adding the CrystalReportViewer control.

The viewer on its own does nothing. ...

Get Sams Teach Yourself Visual Studio® .NET 2003 in 21 Days 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.