PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Principle
  • Implementation
  • Advanced use of groups of reports
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
During the print, the end user may want to:
  • choose or modify the orientation of his report (portrait or landscape).
  • adapt the print to a specific paper format: A4, A3, US Letter, ...
This feature is now available in the print preview via the groups of reports. A combo box allows the user to choose in the print preview the most suitable presentation for the print.
Notes:
  • This feature can be easily enhanced to propose to the user from the preview a set of statistical reports according to the years for example, ...
  • Versions 19 and later
    To propose the same report in different formats, you also have the ability to use the anchoring of controls in the reports. See Anchoring controls in a report for more details.
    New in version 19
    To propose the same report in different formats, you also have the ability to use the anchoring of controls in the reports. See Anchoring controls in a report for more details.
    To propose the same report in different formats, you also have the ability to use the anchoring of controls in the reports. See Anchoring controls in a report for more details.
Principle
To allow the end user to choose the orientation or the format of his report:
  1. Several versions of the same report are created in the report editor:
    • a report in portrait mode / a report in landscape mode,
    • a report in A4 format / a report in A3 format /...
  2. A group of reports is created by programming. This group of reports contains the different versions of the report.
  3. One of the reports found in the group of reports is displayed in the print preview. The user can select via a combo box the configuration of the report to print.
Implementation
To propose different print modes of a report:
  1. Create the initial report and the different versions of the report in a different format (portrait, landscape, A4, 13, ...). Each report has a different name.
  2. In the print code of the initial report:
    • Request the display in the print preview (iPreview).
    • 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 print preview (iGroupPrint). The specified report is displayed in the print preview. The user can select the requested format via the combo box found in the print preview.
Code sample:
// Print preview
iPreview()
// 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 print preview
iGroupPrint()
Advanced use of groups of reports
The groups of reports can be used to propose slightly different reports from the print preview.
Some examples: the groups of reports can be used to display:
  • statistical reports per 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 print preview.
  • reports corresponding to the same theme: the group of reports will contain for example the report for the product form, the reports for the sales statistics, the report for the orders placed during the current month, ...
Minimum required version
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment