PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Creating a report on a programmed data source
  • Overview
  • Creating a report on a programmed data source
  • Programming the reading of records
  • Runtime order of the different WLanguage processes
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 a programmed data source
Overview
In a report on a programmed data source, the reading of the records that will be displayed in the report requires full programming in WLanguage. The data source can have any type (HFSQL file, query, text file, file from an external database, ...).
The creation of a report based on a programmed data source is performed by the wizard for report creation ("File .. New .. Report").The creation of a report based on a programmed data source is performed by the wizard for report creation.
When the report based on a programmed data source is created, you can:
  • modify the data source of report ("Data" tab of report description).
  • add or delete Item controls linked to the data source of the report.

Important

Reports & Queries does not allow you to create reports based on a programmed data source. However, you have the ability to customize the reports on a programmed data source created in the standard report editor (color, fonts, size, ...).
Versions 18 and later
iPhone/iPad This feature is now available for the iPhone/iPad applications.
New in version 18
iPhone/iPad This feature is now available for the iPhone/iPad applications.
iPhone/iPad This feature is now available for the iPhone/iPad applications.
Versions 21 and later
Universal Windows 10 App This feature is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This feature is now available in Universal Windows 10 App mode.
Universal Windows 10 App This feature is now available in Universal Windows 10 App mode.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Creating a report on a programmed data source

Overview

Two steps are required to create a report based on a programmed data source:
  1. Creating the report with the creation wizard.
  2. Programming the reading of records.

Creating a report on a programmed data source

To create a report on a programmed data source:
  1. Select "File .. New .. Report". The wizard for report creation starts.Click among the quick access buttons.
    • Click "Report" in the wheel that is displayed. 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 the data source of the report ("I program the reading of my data source").Select the data source of the report ("Other (programing, text file, memory zone, HyperFileSQL view)"). Then, select "I program the reading of my data source".Select the data source of the report ("Other (programing, text file, memory zone, HFSQL view)"). Then, select "I program the reading of my data source".
  4. For each type of report, specify the corresponding specific options.
    Type of reportSpecific options
    Table report
    • specify the number of columns found in the table.
    • for each column, specify the caption and type of the printed value.
    • modify (if necessary) the order of the different columns.
    Type of report: Table + ChartType of chart, aspect of chart, ...
    Options presented in Table + Chart report
    Chart reportType of chart, aspect of chart, ...
    Options presented in Chart report
    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

    Type of reportSpecific options
    Table report
    • specify the number of columns found in the table.
    • for each column, specify the caption and type of the printed value.
    • modify (if necessary) the order of the different columns.
    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
  5. Specify the format of the sheet on which the report will be printed. The report is printed in A4 format by default.
  6. Select the skin template of report if necessary.
  7. Enter the name and title of the report. This name (".WDE". file corresponding to the report) will be used to identify the report in your programs.
  8. Validate the report creation.
  9. If the report contains a table, the report editor automatically proposes to change the format of the report and/or to reduce the size of the table if some of the table columns cannot be printed in the report.
  10. Specify (if necessary) the mode for reducing the report size:
    • Versions 19 and later
      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.
      New in version 19
      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.
      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.
  11. The report currently created is displayed in the report editor.

Programming the reading of records

The programming required to read the records is presented in the following example:
The information to print is found in the HFSQL file named "Customer". The data is displayed in the item controls.
The following method is used to program the reading of records:
  1. Reading the first record of "Customer" file in the "Report opening" process (HReadFirst).
    // Read the first record of "Customer" file
    HReadFirst(Customer, CustomerNum)
  2. The "Reading the report data" process is used to manage the end of the data file. The following values are returned according to the case:
    • True: end of file not reached (step 3 is run).
    • False: end of file reached (step 3 is not run).
      // End of "Customer" file reached?
      IF HOut() = True THEN
              // Stop printing the Body block
              RESULT False
      ELSE
              // Print the Body block and run its processes
              RESULT True
      END
  3. The "Before printing the BODY block" process is used to manage the file records:
    • Assigning the values of items in the report controls.
    • Reading the next record.
      // Assign the values of items in the report controls
      ITEM_Company = Customer.Company
      ITEM_Name = Customer.CustomerName
      ITEM_Address = Customer.Address
      ITEM_ZC = Customer.ZC
      ITEM_City = Customer.City

      // Read the next record
      HReadNext(Customer)
  4. The "After printing the Body block" process is used to manage a page break, if each page must contain a single Body block.
    Note: In the description window of the Body block, the "Page break after block" option is not applied for a report based on a programed data source.
    // Page break as long as records are still found
    IF HOut() = False THEN
    iPageEnd()
    END

Runtime order of the different WLanguage processes

The runtime order of the different WLanguage processes used to read the records are presented in the following table:
Runtime order of the report processesProgramming required for reading the text file
1. Opening the reportReading the first record (HReadFirst for example).
2. Reading the report dataManaging the end of the data file.
3. Before printing the Body blockAssigning the values of items in the report controls and reading the next record (HReadNext for example).
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment