Adding the Report Viewer to a Windows Form

Earlier in the chapter, we quickly dragged the Report Viewer onto a form and previewed your first report—the good news is that there is not much more involved in adding the Report Viewer to a form in your application. The Crystal Report Viewer is available from the Windows Forms Toolbox and you can drag it directly onto your form or draw the viewer on your form to the size required.

You can easily add the Crystal Report Viewer to an existing form to display a report side-by-side with other controls, or you could add the report to a new form to have a separate window for previewing reports.

If you are going to use a separate form for previewing reports, try changing the Dock property of the Crystal Report Viewer to Fill so it will fill the entire page. To change this property, right-click the Crystal Report Viewer you have dragged or drawn on your form and select the viewer's properties. From the property page shown subsequently, locate the Dock property and use the drop-down list to select the docking for this component (see Figure 4-9).

You can also add a margin around the docked viewer by setting the Dock Padding properties, which would add blank space around the viewer using the settings and margin you specified.

Productivity Planner
Figure 4-9

Was this article helpful?

0 0


  • linda
    When crystalreport viewer is dragged on windows form what property need to change?
    6 years ago

Post a comment