|
|
|
|
|
- Overview
- Principle
- Implementation
- Advanced use of report groups
Report viewer: Offer several reports
In the document preview, end users can: - choose or change the orientation of their reports (portrait or landscape).
- adapt printing to a specific paper format: A4, A3, US Letter, etc.
This functionality is available in the report viewer via report groups. Users can choose the best layout in the report viewer via a combo box. Remarks: - This functionality can easily be improved, for example, to provide the user with a set of statistical reports by year directly from the report viewer...
- To use the same report in different formats, you can set anchors on the controls of the reports. For more details, see Anchoring controls in a report.
To allow end users to choose the orientation and format of their reports: - Several versions of the same report are created in the report editor:
- a report in portrait mode / a report in landscape mode,
- A4 format / A3 format / etc.
- A report group is created programmatically. This report group contains the different versions of the report.
- One of the reports from the report group is displayed in the report viewer. The user can select via a combo box the configuration of the report to print.
To propose different print modes of a report: - Create the initial report and the different versions of the report in a different format (portrait, landscape, A4, 13, etc.). Each report has a different name.
- In the print code of the initial report:
- Request the display in the report viewer (iDestination).
- Add the different reports into a group via iGroupAdd. If the report expects parameters, specify these parameters with iGroupAdd.
- Customize (if necessary) the image and the caption found in the combo box for report selection via iGroupConfigure. By default:
- an image corresponding to the format is displayed.
- the format characteristics are specified (available in the "Format" tab of the description window of the report).
- Start the report print in the report viewer (iGroupPrint). The specified report is displayed in the report viewer. The user can select the requested format via the combo box found in the report viewer.
Code sample: // Display in the report viewer iDestination(iViewer) // Add the report to the group iGroupAdd(RPT_Chart_Portrait) // Configure its caption iGroupConfigure(RPT_Chart_Portrait, "Print in Portrait mode") // Add the report to the group iGroupAdd(RPT_Chart_Landscape) // Configure its caption iGroupConfigure(RPT_Chart_Landscape, "Print in Landscape mode") // Start printing the first report in the report viewer iGroupPrint()
Advanced use of report groups The report groups can be used to provide different reports from the report viewer. For example, you can use report groups to display: - statistical reports by year: the same report is displayed several times. Only the parameter specifying the year is modified. The user can directly display the reports for the different years from the report viewer.
- reports corresponding to the same theme: the report group will include, for example, the product form report, the sales statistics report, the orders report for the current month, etc.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|