PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • 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/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
When printing an Document, the end user sometimes wants to:
  • choose or change the orientation of their reports (portrait or landscape).
  • adapt the print to a specific paper format: A4, A3, US Letter, etc.
This functionality is available in the report viewer through the report groups. The user can choose via a combo in the report viewer the most suitable presenter at the time of printing.
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...
  • Versions 19 and later
    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.
    New in version 19
    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 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 group of reports is created through 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 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, ...). 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 sample:
// Affichage dans le visualisateur de rapports
iDestination(iViewer)
// Ajout de l'état au groupe
iGroupAdd(ETAT_Graphe_Portrait)
// Paramétrage de son libellé
iGroupConfigure(ETAT_Graphe_Portrait, "Impression en mode Portrait")
// Ajout de l'état au groupe
iGroupAdd(ETAT_Graphe_Paysage)
// Paramétrage de son libellé
iGroupConfigure(ETAT_Graphe_Paysage,"Impression en mode Paysage")
// Lancement de l'impression du premier état dans le visualisateur de rapports
iGroupPrint()
Advanced use of groups of reports
The groups of reports can be used to propose slightly different reports from the report viewer.
For example: 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 report viewer.
  • 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 version required
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment