PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Characteristics of report on Looper control
  • Creating a report on Looper control from the window editor
  • Creating a report automatically and a button used to print the report
  • Characteristics of created report on Looper control
  • Creating a report on Looper control from the report editor
  • Creating a report on Looper control from the report editor
  • Printing a report on Looper control
  • Printing a report on Looper control
  • WINDEV and WINDEV Mobile example
  • WEBDEV example
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
Report on Looper control
Overview
The report on Looper control is used to directly print the information displayed in a Looper control (browsing looper, memory looper or looper on source) found:
  • in a window or page of application. This window or page must be displayed when printing the report.
  • in a window or in an internal page. The window (or the page) that displays the internal window (or the internal page) must be displayed.

Important

Reports & Queries cannot be used to create reports on Looper control. However, you have the ability to customize the reports on Looper control created in the standard report editor (color, fonts, size, ...).
A report on Looper control can print:
  • all the rows displayed in the Looper control.
  • the rows selected by the user (case of multi-selection Looper controls where the rows are selected via the [Ctrl] key). This option is not available in WEBDEV.
Characteristics of report on 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 Looper control corresponds to a Static 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 currently edited.
A report on Looper control can be created:
  • from the window editor. The created report corresponds to a table report.
  • from the report editor. The wizard for report creation starts and it allows you to choose the type of report to create (table, form, ...).
Once the report on Looper control is created, you can:
  • modify the data source of report ("Data" tab of report description).
  • add or delete Static controls linked to the Looper control associated with the report.
Caution: The test of a report on Looper control cannot be run from the report editor because the window or the page containing the Looper control must be opened. To run the test of a report on Looper control, you must:
  • create (if necessary) a button in the window or in the page of Looper control. This button is used to print the report on Looper control (iPrintReport).
    Case of internal windows: If the Looper control is found in an internal window, the button should be created 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 is hosting the internal window.
Creating a report on Looper control from the window editor
WINDEVWINDEV Mobile The window editor allows you to automatically create a report on Looper control and a button used to print the report. No programming is required.
Note : The window editor can only be used to create a table report. To create another type of report, use the report editor.
WINDEVWINDEV Mobile

Creating a report automatically and a button used to print the report

To automatically create a report and a button used to print the report:
  1. Open the window containing the Looper control on which the report will be based.
  2. Select the Looper control.
  3. On the "Creation" pane, in the "Data" group, expand "Looper" and select "Report on Looper".
  4. The mouse cursor changes and the button shape appears under the cursor. Click in your window to create and position the button. This button is used print the report on Looper control.
  5. A table report based on the selected Looper control is automatically created in the report editor. See Characteristics of created report for more details.
  6. Confirm that the created report must be added into the current project.
  7. Save the created report and the window containing the Looper control.
WINDEVWINDEV Mobile

Characteristics of created report on Looper control

By default:
  • the created report is a Table report. See The different types of reports for more details.
  • the created report is named "Report_<CaptionLooperControl>".
  • the created report contains:
    • a table containing as many columns as the number of attributes found in the Looper control (even if these attributes display no value).
      By default, the width of columns in this table corresponds to the width of controls associated with the attributes.
      If the table does not occupy the entire report width, the table columns are proportionally enlarged in order for the table to reach its maximum size.
    • a Static control displaying the caption of Looper control.
    • four preset controls used to display today's date, the number of the current page, the total number of pages in the report and the total number of lines printed in the report.
  • the skin template of created report corresponds to the skin template of current project.
  • the report prints all the rows found in the Looper control.
All these characteristics can be modified in the report editor.
Creating a report on Looper control from the report editor
The report editor allows you to create any type of report based on a Looper control (table, form, ...).
Once the report is created, the print must be programmed in WLanguage. See Printing a report on Looper control for more details.

Creating a report on Looper control from the report editor

To create a report on Looper control from the report editor:
  1. Click New among the quick access buttons.
    • The window for creating a new element is displayed: click "Report" then "Report". }
    • The wizard for report creation starts.
  2. Choose the layout of your report (table, form, label, ...). See The different types of reports for more details.
  3. Select (if necessary) the report template to use. A report template is used to comply with a specific page layout. See The report templates for more details.
  4. Select the data source of report ("From a Table or Looper control").
  5. Select the Looper control on which the report will be based. Only the Table and Looper controls found in the windows or in the pages of current project are proposed.
  6. WINDEVWINDEV Mobile To print:
    • all the rows displayed in the Looper control: select "All the control rows".
    • the rows selected by the user: select "The rows selected in the control".
      Note: This choice can be modified by programming with ..SelectionOnly.
  7. 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:
        =Caption before the control
      • in the column header (for the Table reports). For example:
        Caption in the columns

        This caption can be modified in the report editor.
    • select the block where the control associated with the attribute of Looper control will be printed. The positions of different controls can be modified in the report editor. See Report blocks for more details.
  8. Modify (if necessary) the display order of controls in the report with the arrow buttons found on the right of table.
  9. 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 control will be created in the End of document block.
    • calculation on break: a Calculated control will be created in the Break footer block. In the calculations on break, the calculation result is re-initialized after each break. To perform a calculation on break, a break must be found in the report currently created.
  10. Depending on the type of report currently created, indicate the specific options.
    Type of reportSpecific options
    Report on formForm image, printing the form image, ...
    Options presented in Report on form
    Label reportFormat of labels, number of identical copies, ...
    Options presented in Label report
  11. Specify the format of the sheet on which the report will be printed. The report is printed in A4 format by default.
    Note: By default, the report controls are displayed in a single column. To create a multi-column report, the requested number of columns must be specified in the "Format" tab of the description window of report.
  12. Select the skin template of report if necessary.
  13. Type the name and title of report (name of ".WDE" file corresponding to the report). This name will be used to identify the report in your programs.
    WINDEV You also have the ability to specify whether the report can be modified by the end user in "Reports & Queries".
  14. Validate the report creation.
  15. 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 the table columns.
  16. 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. See Multi-page print for more details.
    • Use the landscape mode.
    • Reduce the report size. Caution: according to the reduction percentage, the printed report may become unreadable.
  17. The report currently created is displayed in the report editor.
Printing a report on Looper control

Printing a report on Looper control

A report on Looper control must be printed from the window displaying the Looper control to print. If the button was not created automatically, you must:
  1. Create a button in the window (or page) containing the Looper control.
  2. Configure the destination of report print:
    • WINDEV In WINDEV, with iPreview (print preview, print in an HTML file, ...).
    • WEBDEV - Server code In WEBDEV, with iDestination (print in an HTML file, ...).
    • Windows Mobile In Windows Mobile, with iConfigure or iParameter. These functions open a dialog box allowing the user to select the default printer.
      See Print modes of report for more details.
  3. Specify the name of report to print with iPrintReport.
Notes:
  • If additional parameters must be passed to the report, these parameters must be specified in iPrintReport, after the name of report to print. See Report with parameters for more details.
  • WINDEVWindows Mobile If the window containing the Looper control, source of report, is opened several times (non-modal opening by OpenChild), the full name of Looper control to print must be passed in parameter to the report. For example:
    // The ..FullName property will contain the window name
    // that must be opened with an alias
    // to distinguish between each window
    iPrintReport(RPT_LOOP_Customer, LOOP_Customer..FullName)

    // Opening code of report:
    PROCEDURE RPT_LOOP_Customer(sNameSourceLOOP)
    MyReport..SourceName = NameSourceLOOP
  • WINDEVWindows Mobile ..SelectionOnly is used to find out and modify the records that will be printed in the report: printing all records or the selected records only.

Important

In Reports & Queries, a report can be printed:
  • by starting a print ( Print icon ).
  • by running the report test ( Report Go ).
Therefore, no programming is required to print the report.
WINDEVReports and QueriesWindows Mobile

WINDEV and WINDEV Mobile example

The information to print is contained in the Looper control named "LOOP_Customer" found in the "WIN_Customer" window.
The report to print is named "RPT_LOOPCustomer" and it is printed when clicking the "BTN_Print" button.
In this example, the click code of "BTN_Print" button is as follows:
In WINDEV:
// Open the preview window
iPreview()
// Print the report based on the "LOOP_Customer" control
iPrintReport(RPT_LOOPCustomer)
In Windows Mobile:
// Select the printer
iConfigure()
// Print the report based on the "LOOP_Customer" control  
iPrintReport(RPT_LOOPCustomer)
WEBDEV - Server code

WEBDEV example

The information to print is contained in the Looper control named "LOOP_Customer" found in the "PAGE_Customer" page.
The report to print is named "RPT_LOOPCustomer" and it is displayed in a PDF file when clicking the "BTN_Print" button.
In this example, the click code of "BTN_Print" button is as follows:
// Generates a unique file name
UniqueFileName is string = fWebDir() + "\" + ...
"RPT_Customer_" + DateSys() + TimeSys() + ".pdf"
// Configures the print destination
iDestination(iPDF, UniqueFileName)
// Prints the report based on the "LOOP_Customer" control
iPrintReport(RPT_LOOPCustomer)
// Displays the report in PDF format
FileDisplay(UniqueFileName, "application/pdf")
// Deletes the file
fDelete(UniqueFileName)
Minimum required version
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment