The Reports for WinForms assembly now provides two distinctly different methods for generating reports:
While many existing reports can be correctly generated using either method, there are some important differences between the two. Some of the key differences are listed below.
The ImportC1Report method creates a data-bound C1PrintDocument component. The C1PrintDocument component is then generated with data being fetched. The resulting document can be refreshed with data refreshing. When the C1Report component is used, the generated document already contains embedded data fetched during document generation, and the resulting document is not data-bound (but of course, the report can be rendered again, refreshing the data).
When a report is imported in the resulting C1PrintDocument structure, all fields are represented by RenderField, and all sections by RenderSection objects. If a report definition contains groups, each group is represented by a RenderArea object, with nested RenderSection objects for the group header and footer, and a RenderArea for the nested group.
When the C1Report component is used, each report section is rendered into a RenderArea object. The fields are rendered as follows:
When a report with unset (or set to zeros) CustomWidth and CustomHeight properties is imported on a system without a printer, the default page size depends on the locale, as always in C1PrintDocument (for example, for US and Canada, the page size will be Letter, for Russia A4, and so on).
When such report is loaded into the C1Report component, the page size is always set to Letter (8.5 x 11 inches), which is the behavior of C1.Win.C1Report.C1Report.
On a system with one or more printers installed, the default page size for an imported report is determined using the same logic as for a regular C1PrintDocument (in particular, the MeasurementPrinterName property is used to determine which printer to use). The main reason for this behavior is to avoid long wait times on systems with default network printers. When the C1Report component is used, the default page size is determined by the system default printer.
The import method has some inherent limitations which are not likely to ever be lifted. These limitations include: