ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Editors / Report editor / Report viewer
  • Overview
  • Principle
  • Implementation
  • Advanced use of report groups
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
In the document preview, end users can:
  • choose or change the orientation of their reports (portrait or landscape).
  • adapt the print job 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.
Principle
To allow end users to choose the orientation and format of their reports:
  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 report group is created through programming. This report group contains the different versions of the report.
  3. 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.
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, etc.). Each report has a different name.
  2. 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 example:
// 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: the report groups 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 report viewer.
  • reports corresponding to the same theme: the report group will include, for example, the report of the product form, the report of the sales statistics, the report of the orders for the current month, etc.
Minimum version required
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help