|
|
|
|
|
- Overview
- Characteristics of a report based on a Looper control
- Creating a report based on a Looper control from the window editor
- Creating a report automatically and a button used to print the report
- Characteristics of the report based on a Looper control
- Creating a report based on a Looper control from the report editor
- Creating a report based on a Looper control from the report editor
- Printing a report based on a Looper control
- Printing a report based on a Looper control
- WINDEV example
- WEBDEV example
Report based on a Looper control
A report based on a Looper control is used to directly print the information displayed in the control (based on a data file or populated programmatically): - in a window or page of the application. This window or page must be displayed when printing the report.
- in an internal window or an internal page. The window (or the page) that displays the internal window (or the internal page) must be displayed.
 Reports & Queries cannot be used to create reports based on a Looper control. However, it is possible to customize states on a RepeatString Looper control created in the built-in state editor (color, font, size, etc.). A report based on a Looper control can contain: - all the rows displayed in the Looper control.
- the rows selected by the user (for multi-selection Looper controls where the rows are selected with the Ctrl key). This option is not available in WEBDEV.
Characteristics of a report based on a Looper control If the report is based on a Looper control: - Each row found in the Looper control corresponds to a record.
- Each attribute of the Looper control corresponds to a Static Text control (even the attributes that do not correspond to a value).
For a table report, the order in which the columns are displayed in the report corresponds by default to the order of attributes in the window being edited. A report based on a Looper control can be created: - from the window editor. The created report corresponds to a table report.
- from the report editor. The report creation wizards starts, allowing you to choose the type of report to create (table, form, etc.).
Once the report based on the Looper control has been created, you can: - change the data source of the report ("Data" tab in the report description).
- add or delete Static Text controls linked to the Looper control associated with the report.
Caution: It is not possible to test a report on a RepeatString Looper control directly from the report editor, as the window or page containing the RepeatString Looper control must be open.. To test a report based on a Looper control, you must: - create (if necessary) a button in the window or in the page of Looper control. This button can be used to print the report with the data from the Looper control (iPrintReport).
For internal windows: If the Looper control RepeatString is present in an internal window, it is advisable to create the button in the internal window and not in the host window. - run the test of the window containing the Looper control then run the report test (via the button).
Case of internal windows: the test must be run from the window that hosts the internal window.
Creating a report based on a Looper control from the window editor Creating a report based on a Looper control from the report editor The report editor allows you to create any type of report based on a Looper control (table, form, etc.). Creating a report based on a Looper control from the report editor To create a report based on a Looper control from the report editor: - Click
in the quick access buttons. - The window for creating a new element is displayed: click "Report" then "Report". }
- The report creation wizard starts.
- Choose the layout of your report (table, form, label, ...). For more details, see The different types of reports.
- Select (if necessary) the report template to use. A report template is used to comply with a specific page layout. For more details on report templates, see Report templates.
- Select the data source of the report ("From a Table or Looper control").
- Select the Looper control on which the report will be based. Only the Table and Looper controls in the windows or pages of the current project will appear.
To print:- all lines displayed in the RepeatString field: select the "All lines in the field" option.
- only user-selected lines: select "Only lines selected in the field"..
Remark: This choice can be modified by programming using property SelectionOnly. - For each attribute of the Looper control displayed in the report:
- specify whether the column must be printed or not via the checkmark.
- type the corresponding caption. This caption will be displayed:
- before the control. For example:
- in the column header (for the Table reports). For example:
This caption can be modified in the report editor.
- select the block where the control associated with the attribute of the Looper control will be printed. The positions of different controls can be modified in the report editor. For more details on the different blocks and their position in a report, see Report blocks.
- Modify (if necessary) the display order of controls in the report with the arrow buttons found on the right of table.
- If the Looper control associated with the report contains at least one numeric item, calculations can be performed on these items. Specify the calculation performed for each item (sum, average, ...). Two types of calculations are available:
- general calculation: a Calculated field will be created in the block End of document.
- calculation on breakage: a Calculated field will be created in the Breakage bottom block. In the calculations on break, the calculation result is reinitialized after each break. To perform a calculation on break, a break must be found in the report currently created.
- Depending on the type of report currently created, indicate the specific options.
| | Type of report | Specific options |
---|
Report based on a form | Form image, printing the form image, ... Options presented in detail in Report based on a form | Label report | Format of labels, number of identical copies, ... Options presented in detail in Label report |
- Specify the format of sheet on which the report will be printed. The report is printed in A4 format by default.
Note: By default, report controls are arranged in a single column. To create a multi-column report, simply specify the desired number of columns in the "Format" tab of the report description window. - Select the skin template of the report if necessary.
- Type the name and title of the report (name of ".WDE" file corresponding to the report). This name will be used to identify the report in your programs.
You can also specify whether the report can be modified by the end user in "Reports & Queries". - Validate the report creation.
- The report editor automatically proposes to change the report format if the following conditions are fulfilled:
- the report currently created includes a table.
- the report format does not allow to display all table columns.
- Specify (if necessary) the mode for reducing the report size:
- Print the report on several pages. In this case, the end user will have to group the pages. For more details, see Multi-page print.
- Use the landscape mode.
- Reduce the report size. Please note: depending on the reduction percentage selected, the printed report may become illegible..
- The report currently created is displayed in the report editor.
Printing a report based on a Looper control Printing a report based on a Looper control A report based on a Looper control must be printed from the window containing the Looper control whose data will be printed. If the button was not created automatically, you must: - Create a button in the window (or page) containing the Looper control.
- Set the report print destination with iDestination (PDF file, HTML, etc.).
For more details, see Print modes of a report. - Specify the name of the report to print with iPrintReport.
Remarks: - If additional parameters must be passed to the report, these parameters must be specified in iPrintReport, after the name of the report to print. For more details, see Report with parameters.
If the window that contains the source Looper control is opened multiple times (non-modal opening by OpenChild), the full name of the control to print must be passed as parameter to the report. For example:
// The FullName property will contain the name of the window // that must be opened with an alias // to distinguish between each window iPrintReport(RPT_LOOP_Customer, LOOP_Customer.FullName)
// Opening code of the report: PROCEDURE RPT_LOOP_Customer(sNameSourceLOOP) MyReport.SourceName = NameSourceLOOP The SelectionOnly property is used to identify and modify the records to be printed in the report: print all records or only selected records.
 In Reports & Queries software, you can print a report: - by starting a print job (
). - by testing the report (
).
Therefore, no programming is required to print the report.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|