Serves as base class for all reports.
Namespace: MindFusion.Reporting
Assembly: MindFusion.Reporting
C# Copy Code |
---|
public class Report : Component |
Visual Basic Copy Code |
---|
Public Class Report |
You can create new reports by instantiating from this class. New pages can be added to the report by creating Page objects and adding them to the collection returned by the report's Pages property. Report items are added to the Report indirectly by adding them to one of the pages contained in the report.
An alternative (and much easier) way to create and design reports is to use the integrated MindFusion.Reporting Designer. In order to use the Designer, you need to create a custom class that derives from Report. A convenient way for creating custom report classes is by using the 'MindFusion Report' item template installed in Visual Studio with the MindFusion.Reporting package.
Note |
---|
If you create your custom report class manually, and you want this class to be designable, you need to ensure that the class provides a parameterless constructor and an InitializeComponent method, which should be called from the constructor. |
Once the custom report class is created, double-click on it in the Solution Explorer in order to open the MindFusion.Reporting Designer and open the report.
For more information about the Designer and how to use it, check Report Designer.
Once the report is initialized, you need to process it by calling its Run method. After the report has been processed it is ready to be used in various scenarios.
You can print the report by using a ReportPrinter object. You can open a preview of the report by using the PrintPreviewForm class. For details, check Printing and Print Previewing.
You can display the report on a Windows Form by using the ReportViewer control. For more information on how to do this, visit Displaying Reports on a Windows Form.
You can export the report to PDF or HTML by using the PdfExporter and HtmlExporter classes respectively. Check Exporting for more information.
Finally, you can manually layout the report and render its pages to any IGraphics object. To do this, call the Layout method of the Report class, then use the DrawPage method of the ReportLayout object returned as a result from the method.
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
MindFusion.Reporting.Report