Creating, Loading, and Rendering the Report
Although you can use C1Report in many different scenarios, on the desktop and on the Web, the main sequence of steps is always the same:
1. Create a report definition
This can be done directly with the C1Report Designer application or using the report designer in Microsoft Access and then importing it into C1Report Designer. You can also do it using code, either using the object model to add groups and fields or by writing a custom XML file.
2. Load the report into the C1Report component
This can be done at design time, using the Load Report context menu, or programmatically using the Load method. If you load the report at design time, it will be persisted (saved) with the control and you won't need to distribute the report definition file.
3. Render the report (desktop applications)
If you are writing a desktop application, you can render the report into a C1PrintPreview controleasily. The preview control will display the report on the screen, and users will be able to preview it with full zooming, panning, and so on. For example:
C1PrintPreview1.Document = c1r
• C#
c1printPreview1.Document = c1r;
4. Render the report (Web applications)
If you are writing a Web application, you can render reports into HTML or PDF files using the RenderToFile method, and your users will be able to view them using any browser.
|