PC SOFT

WINDEV的在线文档

  • Overview
  • Creating a report on variable
  • Printing a report on variable
  • Printing a report on variable
  • WinDev and WinDev Mobile examples
  • Notes
  • Printing a report with parameters based on a variable
  • WinDev and WinDev Mobile example
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Report on variable (Databinding)

Overview
A report on variable is used to directly print the information found in a WLanguage variable. This variable can be:
  • a variable global to the project,
  • a variable global to a window or to a page.
  • a variable global to a set of procedures.
This variable can be a simple array, a member of classes, a member of structures or a member of advanced variables.

ImportantReports & Queries cannot be used to create or modify reports on variable.

Creating a report on variable
To create a report on variable:
  1. Select "File .. New .. Report". The wizard for report creation starts.Clickamong 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. In the wizard, 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 ("From an existing variable").
  5. Select the array variable on which the report will be based. Only the variables global to the project or to the windows found in the current application are proposed.
  6. To group the records, you have the ability to create breaks on the array elements. To create breaks, answer "Yes" to the question "Do you want to add breaks to the report?".
    The following plane is used to select the variables corresponding to the breaks.
    Caution: Before printing the report, the array variable must be sorted by programming according to the break variable. This sort will be performed by 排序.
    See Breaks in a report for more details.
  7. Select the variables that must be displayed in the report. The controls associated with these variables will be displayed in the Body block. By default, the caption of the control corresponds to the name of the variable. This caption can be modified in the report editor.
  8. Modify (if necessary) the display order of the controls in the report with the arrow buttons found on the right of the list.
  9. If the variable associated with the report contains at least one numeric item, you have the ability to perform calculations 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 result of the calculation is reinitialized 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
    Type of report: Table + ChartType of the chart, aspect of the chart, ...
    Options presented in Table + Chart report
    Chart reportType of the chart, aspect of the chart, ...
    Options presented in Chart report
    Report on formImage of the form, print the image of the form, ...
    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 formImage of the form, print the image of the form, ...
    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 the report.
  12. Select the skin template of the report if necessary.
  13. Enter the name and title of the report (name of the ".WDE" file corresponding to the report). This name will be used to identify the report in your programs.
  14. Validate the report creation.
  15. The report editor automatically proposes to change the format of the report 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:
    • 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.
      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 size of the report. 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 variable

Printing a report on variable

To print a report on variable, you must:
  1. Initialize the value of the variable used.
  2. Sort the array if necessary (with 数组排序 for example).
  3. Configure the destination of the report print:
  4. Specify the name of the report to print with 打印报表.
If necessary, additional parameters can be specified when printing a report with parameters based on a variable. For example, the name of the array variable to use can be passed in parameter. In this case, the report is a report with parameters based on an array variable (see the following paragraph).

ImportantIn Reports & Queries, a report can be printed:
  • by starting a print ().
  • by running the report test ().
Therefore, no programming is required to print the report.

WinDev

WinDev and WinDev Mobile examples

The "RPT_谷歌事件型" report is based on the MyEvents variable (谷歌事件型 type). This report is used to print the list of events found in a Google calendar.

The "RPT_谷歌事件型" report prints during a click on the "BTN_Event" button. In this example, the click code of "BTN_Event" button is as follows:

WinDev WinDev code:
// Open the preview window
打印预览()
// Print the RPT_谷歌事件型 report
打印报表RPT_谷歌事件型

Notes

  • ..数据源名称 used in the report code allows you to find out and change the name of the variable associated with the report.
  • ..字段显示 used in the report code allows you to find out and change the name of the variable associated with the item.

Printing a report with parameters based on a variable

To print a report with parameters, parameters must be passed to the report. See Reports with parameters for more details.

To print a report with parameters based on a variable, you must:

  1. Initialize the value of the array variable used.
  2. Sort the array if necessary (with 数组排序 for example).
  3. Configure the destination of the report print:
  4. Specify the following parameters with 打印报表:
    • the name of the report to print.
    • the parameters expected by the report (in the order specified in the report).

WinDev

WinDev and WinDev Mobile example

A window lists the organizers and their events. The "RPT_谷歌事件型" report is printed during a click on the "Print the organizer events" button. This report expects in parameter the organizer for which the events must be listed.

WinDev WinDev code:
  • the click code of the "Print the organizer events" button is as follows:
    // Open the preview window
    打印预览()
    // Print the report while passing parameters
    打印报表RPT_谷歌事件型Organizer1】)
  • the code of the report is as follows:
    // Retrieve the parameters passed to the report
    过程RPT_谷歌事件型MyOrganizer