|
|
|
|
|
- Overview of the "Internal report" control
- Control of a report
- Benefits of internal reports compared to the nested reports
- How to?
- 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 uses a specific connection
- Secondary report based on an 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
The "Internal report" control
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.
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 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.
Creating a main report made of several secondary reports To create a main report made of several secondary reports: - Create and save all the secondary reports.
- Create the main report:
- Click in the quick access buttons.
- The new element window appears: click "Report" then "Report". The report creation wizard starts.
- In the wizard, select "Blank report" and validate.
- In the main report, create as many "Internal report" controls as the number of secondary reports to print.
To create an internal report, go to the "Creation" tab, "Structure" group and click "Internal report". Remark: The main report can contain all the other types of controls. - 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.
- Position the "Internal Report" controls in the main report.
- Test the main report ( in 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.
Remark: To define an independent HFSQL context: - Open the report description (select "Report description" in the context menu).
- On the "Data" tab, check "The report execution does not affect iterations (independent HFSQL context)".
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, use iInitReportQuery to pass the parameters to the query. This function must be used in the "Before printing" event of the block containing the "Internal report" control. Secondary report based on a query that uses a specific connection If the secondary report is based on a query that handles a specific connection, use iInitReportQueryConnection to run this query (and to pass parameters if necessary). This function must be used in the "Before printing" event of the block containing the "Internal report" control. Secondary report based on an HFSQL view If the secondary query is based on an HFSQL view: - 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.
- Associate the view with the secondary report (with ViewName) in the opening code of the secondary report:
NameSecondaryReport>.ViewName = <NameGlobalVariable
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, it may not be possible to pass parameters by reference. 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> 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: - Go to the "Format" tab in the description of the secondary report ("Report description" in the context menu).
- Modify the width of the page where the secondary report will be printed.
- Validate.
Page break in the secondary report The page breaks defined in a secondary report will be ignored when printing the main report. Opening the internal report The context menu of the "Internal Report" control in the editor is used to directly open the internal report via "Open the internal report".
Related Examples:
|
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, ...)
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|