PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • "Opening" process of the report
  • Running the process
  • Password of the data file used as source for the report
  • Initializing variables
  • Use examples
  • "Reading data" process
  • Running the process
  • Reports based on a text file
  • Use examples
  • "Filter (take the record into account?)" process
  • Running the process
  • Using the Filter process
  • Use examples
  • "Closing" process of the report
  • Running the process
  • Use examples
  • "Before re-printing" process of the report
  • Running the process
  • Use examples
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
The following processes are associated with the reports (order of appearance in the code editor):
Several processes are associated with the reports. These processes are run when printing the report.
To find out the order in which these processes are run, see Sequence of processes associated with the reports.
"Opening" process of the report

Running the process

The "Opening" process of the report is run when starting the report print.
Reminder: The order in which the processes are run when printing a report (including during a test) is as follows:

Password of the data file used as source for the report

If the data file used as source for the report is password protected, this password must be specified before opening the data file (by HPass for example).
If the data file was not opened before printing the report, the password can be specified in the "Opening" process of the report.
WINDEVReports and Queries

Initializing variables

When printing a report from the print preview, the report is automatically re-run when:
  • the user changes printer.
  • the user uses one of the toolbar buttons (print in PDF mode, in HTML mode, in an email, ...).
In this case, the data printed in the report can differ from the data displayed in the preview.
The variables used by the report must be initialized in the "Report opening" process rather than in the code of the button that starts the print.

Use examples

This process is used to:
  • declare the global variables of the report.
  • modify the report bounds with ..MinValue and ..MaxValue.
  • initialize the passwords of data files if necessary.
  • configure the destination of the print (iPreview).
  • pass parameters to the query linked to the report (iInitReportQuery).
  • retrieve the parameters passed to the report.
  • change the data source of the report.
Note: iPrint must not be used in the opening process of the report.
"Reading data" process

Running the process

This process is run when browsing the records to print (in the print loop), once the record was read.

Reports based on a text file

For the reports based on a text file (with programmed reading), the "Reading data" process is used to read the records found in the text file in order to print them.

Use examples

This process is used to:
  • perform block substitutions (as the next record to print is known).
  • select records.
  • perform specific calculations.
Note: This code returns True if there are still records to print and False if there is no record to print.
To avoid printing a record, use the process named "Filter (take the record into account?)".
"Filter (take the record into account?)" process

Running the process

This process is run:
  • when the data source is initialized (for the reports based on a file, a view or a memory zone).
  • in the print loop, once the record is read (for the reports based on a query or on a table).
This process is used to filter the records that must be displayed in the report.

Using the Filter process

If this process contains code lines, these code lines must return a value:
  • Cancel to stop reading the records (and to stop the print).
  • True to specify that the record matches the filter and that it must be printed.
  • False to specify that the record does not match the filter and that it must not be printed.

Use examples

This process is used to:
  • select records.
  • perform advanced calculations (sub-total, ...) for the reports based on files, views or memory zones.
"Closing" process of the report

Running the process

This process is run when the report print is ended, just before closing the report.
This process must not contain any print functions.
Versions 21 and later
Note: iCurrentFile is used to find out the name of the file generated for the report (for the exports in PDF, HTML, ...).
New in version 21
Note: iCurrentFile is used to find out the name of the file generated for the report (for the exports in PDF, HTML, ...).
Note: iCurrentFile is used to find out the name of the file generated for the report (for the exports in PDF, HTML, ...).

Use examples

This process is used to:
Versions 21 and later
WINDEVReports and Queries
"Before re-printing" process of the report

Running the process

This process is run during a print performed from the print preview (direct print or export in PDF, XLS or RTF format).
This process is run after the "Opening" process of report.
If this process returns:
  • True, the re-print will be performed.
  • False, the re-print will be canceled.
Notes:
  • iDestination used in this process allows you to find out the destination of the report (HTML, PDF, ...).
  • iCurrentFile used in this process allows you to find out the name of the file generated for the report (for the exports in PDF, HTML, ...).

Use examples

This process is used to:
  • find out the quality of the generated PDF before the export in PDF format.
  • add a watermark.
  • ask for a password before the print or the export.
New in version 21
WINDEVReports and Queries
"Before re-printing" process of the report

Running the process

This process is run during a print performed from the print preview (direct print or export in PDF, XLS or RTF format).
This process is run after the "Opening" process of report.
If this process returns:
  • True, the re-print will be performed.
  • False, the re-print will be canceled.
Notes:
  • iDestination used in this process allows you to find out the destination of the report (HTML, PDF, ...).
  • iCurrentFile used in this process allows you to find out the name of the file generated for the report (for the exports in PDF, HTML, ...).

Use examples

This process is used to:
  • find out the quality of the generated PDF before the export in PDF format.
  • add a watermark.
  • ask for a password before the print or the export.
WINDEVReports and Queries
"Before re-printing" process of the report

Running the process

This process is run during a print performed from the print preview (direct print or export in PDF, XLS or RTF format).
This process is run after the "Opening" process of report.
If this process returns:
  • True, the re-print will be performed.
  • False, the re-print will be canceled.
Notes:
  • iDestination used in this process allows you to find out the destination of the report (HTML, PDF, ...).
  • iCurrentFile used in this process allows you to find out the name of the file generated for the report (for the exports in PDF, HTML, ...).

Use examples

This process is used to:
  • find out the quality of the generated PDF before the export in PDF format.
  • add a watermark.
  • ask for a password before the print or the export.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment