PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Creating a report on a HFSQL view
  • Printing a report on a HFSQL view
  • To print a report on HFSQL view
  • WINDEV example
  • Windows 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 HFSQL view
HFSQLHFSQL Client/ServerAvailable only with these kinds of connection
Overview
A report on a HFSQL view is used to print records coming from a HFSQL Classic or Client/Server view.
Reminder: A HFSQL view corresponds to a "memory image" of a data file. A view is stored in memory, which insulates it from the modifications made to the associated data file. Once created, a view can be handled like any HFSQL data file. See The HFSQL views for more details.
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.
Characteristics of a report on a HFSQL view:
  • a report on a HFSQL view is linked to the base file of this HFSQL view. The report is used to print the records coming from this base file.
  • the order in which the records are printed corresponds to the order of the records found in the HFSQL view (defined when creating the view or by HSortView).
A report on a HyperFileSQL view is created via the wizard for report creation ("File .. New .. Report").A report on a HFSQL view is created via the wizard for report creation.
When the report on a HFSQL view is created, you have the ability to:
  • modify the data source of report ("Data" tab of report description).
  • add or delete Item controls linked to the HFSQL view associated with the report.

Important

Reports & Queries cannot be used to create reports on a HFSQL view. However, you have the ability to customize the reports on HFSQL view created in the standard report editor (color, fonts, size, ...).
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Creating a report on a HFSQL view
To create a report on a HFSQL view:
  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 (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 the report ("Other (programming, text file, memory zone, HyperFileSQL view, ..." option).Select the data source of the report ("Other (programming, text file, memory zone, HFSQL view, ..." option).
  5. Select the type of data source for the report ("From a HyperFileSQL view")Select the type of data source for the report ("From a HFSQL view").
  6. Select the base data file of the HFSQL view associated with the report.
  7. Select the items displayed in the report. Only the controls linked to the items of the HFSQL view will be filled.
    For each item displayed in the report:
    • type the corresponding caption. This caption will be displayed:
      • before the item. 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 item 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 HFSQL view associated with the report contains at least one numeric item, you have the ability to perform calculations 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 (useless in this type of report).
  10. Depending on the type of report currently created, indicate the specific options.
    Type of reportSpecific options
    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
    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:
    • 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.
  17. The report currently created is displayed in the report editor.
Printing a report on a HFSQL view

To print a report on HFSQL view

  1. Create the HFSQL view with HCreateView (or with HMergeView).
  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 following parameters via iPrintReport:
    • the name of the report to print.
    • the name of the HFSQL Classic view used.
Notes:
  • The HFSQL view must be created and initialized before printing the report. Only a HFSQL Classic or Client/Server view can be used.
  • If additional parameters must be passed to the report, these parameters must be specified in iPrintReport, after the name of the HFSQL view used. See Report with parameters for more details.
  • ..ViewName used in the report code allows you to find out and change the HFSQL view associated with the report.
  • ..SourceName used in the report code allows you to find out and modify the base data file of the HFSQL view associated with the report.

Important

In Reports & Queries, a report can be printed:
  • by starting a print ( ).
  • by running the report test ( or "Code .. Run the report test").by running the report test ( ).
Therefore, no programming is required to print the report.
WINDEVReports and Queries

WINDEV example

The user selects the reference of an order in a list. The "BTN_Print" button is used to:
  • create the HFSQL view named "OrderView" containing the order lines (HCreateView).
  • open the preview window (iPreview).
  • print the "RPT_View" report (iPrintReport).
In this example, the click code of "BTN_Print" button is as follows:
// Create the view
SI HCreateView("OrderView", OrdLine, "*", "Reference", "", "", ...
hViewExclusive + hViewBreakable) = False THEN
Error(HErrorInfo())
ELSE
// Open the preview window
iPreview()
// Print the RPT_View report
iPrintReport(RPT_View, "OrderView")
END
Windows Mobile

Windows Mobile example

The user selects the reference of an order in a list. The "BTN_Print" button is used to:
  • create the HFSQL view named "OrderView" containing the order lines (HCreateView).
  • print the "RPT_View" report (iPrintReport).
In this example, the click code of "BTN_Print" button is as follows:
// Create the view
SI HCreateView("OrderView", OrdLine, "*", "Reference", "", "", ...
hViewExclusive + hViewBreakable) = False THEN
Error(HErrorInfo())
ELSE
// Select the printer
iConfigure()
// Print the RPT_View report
iPrintReport(RPT_View, "OrderView")
END
WEBDEV - Server code

WEBDEV example

The Web user selects the reference of an order in a list. The "BTN_Print" button is used to:
  • create the HFSQL view named "OrderView" containing the order lines (HCreateView).
  • print the "RPT_View" report in a PDF file (iPrintReport).
In this example, the click code of "BTN_Print" button is as follows:
// Create the view
SI HCreateView("OrderView", OrdLine, "*", "Reference", "", "", ...
hViewExclusive + hViewBreakable) = False THEN
Error(HErrorInfo())
ELSE
// Generate a unique file name
UniqueFilename is string = fWebDir() + "\" + "REPORT_View_" + ...
DateSys() + TimeSys() + ".pdf"
// Configure the destination of the print
iDestination(iPDF, UniqueFilename)
// Print the RPT_View report
iPrintReport(RPT_View, "OrderView")
// Send the file to the browser
FileDisplay(UniqueFilename, "application/pdf")
END
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