CrystalReportViewer


At this point, the report is ready to generate output, but you still need to display the result somehow. One way to view the report is using a CrystalReportViewer control.

Open a form, select the Toolbox’s Crystal Reports section, and add a CrystalReportViewer control to the form. Select the control, open the Properties window, click the control’s ReportSource property, and click the drop-down arrow on the right. Select the entry labeled TestScores.StudentTestScores. Here TestScores is the project’s namespace and StudentTestScores is the name of the report you created in the previous section.

When you select this entry, Visual Basic creates an instance of the report, adds it to the form’s component area, and attaches the CrystalReportViewer control to the new instance so the CrystalReportViewer displays the report. If you run the program now, you will see a result similar to the one shown in Figure 25-17.

image from book
Figure 25-17: The initial report may need some formatting changes.




Visual Basic 2005 with  .NET 3.0 Programmer's Reference
Visual Basic 2005 with .NET 3.0 Programmer's Reference
ISBN: 470137053
EAN: N/A
Year: 2007
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net