PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview of the "Internal report" control
  • Control of a report
  • Benefits of internal reports compared to the nested reports
  • How to proceed?
  • Creating a main report made of several secondary reports
  • Main report not blank
  • Secondary report
  • Secondary report based on a query with parameters
  • Secondary report based on a query that is using a specific connection
  • Secondary report based on a HFSQL view
  • Passing parameters to an internal report
  • Notes
  • Dimension of secondary reports
  • Reducing the width of a secondary report
  • Page break in the secondary report
  • Opening the internal report
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 of the "Internal report" control

Control of a report

The "Internal report" controls are used to print several reports (secondary reports) in a single report (main report) without programming.
For example, the following main report is made of two secondary reports printed side-by-side:
  • a report displaying the data in a table.
  • a report displaying the data in a chart.
Versions 18 and later
iPhone/iPad This type of control is now available for the reports in the iPhone/iPad applications.
New in version 18
iPhone/iPad This type of control is now available for the reports in the iPhone/iPad applications.
iPhone/iPad This type of control is now available for the reports in the iPhone/iPad applications.
Versions 21 and later
Universal Windows 10 App This type of control is now available for the reports found in the applications in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This type of control is now available for the reports found in the applications in Universal Windows 10 App mode.
Universal Windows 10 App This type of control is now available for the reports found in the applications in Universal Windows 10 App mode.
Benefits of internal reports compared to the nested reports
The nested reports can also be used to print several secondary reports in a main report. The secondary reports are printed one below another.
To print these secondary reports, use iPrintReport in the code of the block where the secondary reports must be printed.
The internal reports are used to print several reports without programming:
  • one below another.
  • side by side.
How to proceed?

Creating a main report made of several secondary reports

To create a main report made of several secondary reports:
  1. Create and save all the secondary reports.
  2. Create the main report ("File .. New .. Report .. Blank report").Create the main report:
    • Click among the quick access buttons.
    • Click "Report" in the wheel that is displayed. The wizard for report creation starts. The window for creating a new element is displayed: click "Report" then "Report". The wizard for report creation starts.
    • In the wizard, select "Blank report" and validate.
  3. In the main report, create as many "Internal report" controls as the number of secondary reports to print ("Insert .. New internal report" or ).In the main report, create as many "Internal report" controls as the number of secondary reports to print.
    To create an internal report, on the "Creation" pane, in the "Structure" group, click "Internal report".
    Note: The main report can contain all the other types of controls.
  4. Associate each "Internal report" control with a secondary report ("Printed report" in the "General" tab of the control description). The secondary report will be entirely printed in the "Internal report" control.
  5. Position the "Internal Report" controls in the main report.
  6. Run the test of the main report ("Code .. Run the report test") to check the printout of your report.Run the test of the main report ( among the quick access buttons) to check the print of your report.

Main report not blank

If the main report and the secondary reports have the same data source, we recommend that you use an independent HFSQL context:
  • for the main report.
  • for the secondary reports.
Note: To define an independent HFSQL context:
  1. Display the description of the report ("Report description" from the popup menu of the report).
  2. In the "Data" tab, check (or not) "The execution of the report does not affect the browse operations (independent HyperFileSQL context)".In the "Data" tab, check "The execution of the report does not affect the browse operations (independent HFSQL context)".
Note: From version 19, HFSQL is the new name of HyperFileSQL.

Secondary report

A secondary report can contain all types of controls except for the "Internal report" controls.

Secondary report based on a query with parameters

If the secondary report is based on a query with parameters, iInitReportQuery must be used to pass the parameters to the query. This function must be used in the "Before printing" process of the block containing the "Internal report" control.

Secondary report based on a query that is using a specific connection

If the secondary report is based on a query that handles a specific connection, iInitReportQueryConnection must be used to run this query (and to pass parameters if necessary). This function must be used in the "Before printing" process of the block containing the "Internal report" control.

Secondary report based on a HFSQL view

If the secondary query is based on a HFSQL view:
  1. Declare a global variable (character string) in the project and assign the name of the HFSQL view to this variable before running the main report.
  2. Associate the view with the secondary report (with ..ViewName) in the opening code of the secondary report:
    <NameSecondaryReport>..ViewName = <NameGlobalVariable>
Note: From version 19, HFSQL is the new name of HyperFileSQL.

Passing parameters to an internal report

The parameters given to the report (during the call to iPrintReport) are automatically sent to the internal report. Caution: in this case, passing parameters by address is not guaranteed.
To pass parameters to an internal report, we recommend that you use global variables. For example, a global variable can be declared in the calling report. This variable can then be handled in the internal report via the following syntax:
<NameCallingReport>.<Variable Name>
Notes

Dimension of secondary reports

When printing the main report, the width of secondary reports is adjusted in relation to the width of the "Internal report" control.
All the blocks found in the secondary reports will be printed. The main report will automatically adapt to the height of the secondary reports by:
  • increasing (if necessary) the height of the "Internal report" control.
  • increasing (if necessary) the height of the block containing the "Internal report" control.
  • moving to the bottom the controls located below the "Internal report" control.

Reducing the width of a secondary report

To reduce the width of a secondary report:
  1. Display the "Format" tab in the description of the secondary report ("Report description" from the popup menu of the report).
  2. Modify the width of the page where the secondary report will be printed.
  3. Validate.

Page break in the secondary report

The page breaks defined in a secondary report will be ignored when printing the main report.
Versions 16 and later

Opening the internal report

The popup menu of the "Internal Report" control in the editor is used to directly open the internal report via "Open the internal report".
New in version 16

Opening the internal report

The popup menu of the "Internal Report" control in the editor is used to directly open the internal report via "Open the internal report".

Opening the internal report

The popup menu of the "Internal Report" control in the editor is used to directly open the internal report via "Open the internal report".
Related Examples:
WD Reports Training (WINDEV): WD Reports
[ + ] This example presents the different methods for creating a report:

- prints based on different data sources (queries, variables, ...)
- prints based on controls (Table, Spreadsheet, PVT, ...)
- printing composite reports
- specific prints (portrait/landscape, report with watermark, report with bar code, ...)
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment