Understanding the CrystalDecisions.Windows.Forms Namespace
The CrystalDecisions.Windows.Forms namespace consists of a number of classes that provide functionality specific to viewing reports. As you look through the classes below, you can easily map each back to some function within the viewer itself. In the section immediately following, we are going to look at each of these classes in depth and learn what can be done with each.
Class
Description
CrystalReportViewer
Contains the properties, methods, and events relating to the CrystalReportViewer and viewing reports.
DrillEventArgs and DrillSubreportEventArgs
Provides data for the Drill and DrillDownSubreport events on main and subreports. Drill events fire when a user drills down into a group or summary on a particular report or subreport.
ExceptionEventArgs
Provides data for the HandleException event. A HandleException event occurs when there is an error or exception when setting the report properties or viewing the report. It is primarily used for troubleshooting and error messages.
PageNavigateEventArgs
Provides data for the Navigate event. When a user navigates through the pages of a report, the Navigate event fires each time. This can be used to notify the users when they have reached the last page, call custom actions, etc.
SearchEventArgs
Provides data for the Search event. The CrystalReportViewer includes an integrated search function to search for values within a report. The Search event fires when a user searches for a value and could be used to trigger a search of another report or other report descriptions.
ViewerEventArgs
Provides data for the Viewer events. The Viewer event fires when some action has occurred within the viewer itself (for instance, when the report has been loaded) and can be used to launch other actions when the viewer loads.
ZoomEventArgs
Provides data for the ViewZoom event. The ViewZoom event fires when the zoom is changed on the viewer and can be used to suggest the best resolution for a particular report. Also, if you are showing two reports in viewers side-by-side, it can be used to synchronize the zoom factor between the two.