PC SOFT

WINDEV的在线文档

  • Overview
  • Creating a report on a memory zone
  • Printing a report on a memory zone
  • WinDev 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 a memory zone

Overview
A report on a memory zone is used to print the records stored in a memory zone. The memory zone must necessarily contain all the numbers of the records that must be printed.

Note: This type of report is not available in WinDev Mobile.

Characteristics of a report on a memory zone:

  • a report on a memory zone is linked to the base data file of this memory zone. The report is used to print the records coming from this base data file.
  • the order in which the records are printed corresponds to the order of the record numbers found in the memory zone.
You can for example:
  • store in a memory zone the numbers of the records selected by one or more processes.
  • print the records only when the selection is performed.
The creation of a report on a memory zone is performed via the wizard for report creation ("File .. New .. Report").The creation of a report on a memory zone is performed via the wizard for report creation.

To run the test of a report on a memory zone, you must:
  • create and initialize the memory zone.
  • print the report.
When the report on a memory zone is created, you can:
  • modify the data source of the report ("Data" tab of the report description).
  • add or delete Item controls linked to the memory zone associated with the report.

ImportantReports & Queries cannot be used to create reports on a memory zone. However, you have the ability to customize the reports based on a memory zone created in the standard report editor (color, fonts, size, ...).

Creating a report on a memory zone
To create a report on a memory zone:
  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. 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 (programing, text file, memory zone, HyperFileSQL view, ...").Select the data source of the report ("Other (programming, text file, memory zone, HFSQL view, ...").
  5. Select the type of data source ("From a memory zone that was filled by programming").
  6. Select the base data file of the memory zone associated with the report.
  7. Select the sort items for the report. These items will be used to sort the data printed in the report. See Sorts in a report for more details.
  8. To group the records, you have the ability to create breaks on the sort items. To create breaks, answer "Yes" to the question "Do you want to add breaks to the report?".
    The next step is used to select the sort items corresponding to the breaks. See Breaks in a report for more details.
  9. Select the items displayed in the report. Only the controls linked to the items of the memory zone will be filled.
    For each file item displayed in the report:
    • enter the corresponding caption. This caption will be displayed:
      • before the item. For example:
      • in the header of the column (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 must be printed. The positions of the different controls can be modified in the report editor. See Report blocks for more details.
  10. Modify (if necessary) the display order of the controls in the report with the arrow buttons found on the right of the table.
  11. If the base data file of the memory zone 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.
  12. 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
  13. 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.
  14. Select the skin template of the report if necessary.
  15. 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.
    WinDev You also have the ability to specify whether the report can be modified by the end user in "Reports & Queries".
  16. Validate the report creation.
  17. 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.
  18. 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.
  19. The report currently created is displayed in the report editor.

Printing a report on a memory zone
To print a report on a memory zone:
  1. Create the memory zone with 内存创建.
  2. Add records into the memory zone with 内存添加 and sort these records (if necessary) with 内存排序.
  3. Configure the destination of the report print with 打印预览 (print preview, print in an HTML file, ...). See Print modes of a report for more details.
  4. Specify the following parameters with 打印报表:
    • the name of the report to print.
    • the name of the memory zone used.
  5. Delete the memory zone with 内存删除全部 at the end of report print.
Notes:
  • To optimize the resources used on a Pocket PC, printing a report based on a memory zone is not available in WinDev Mobile.
  • If additional parameters must be passed to the report, these parameters must be specified in 打印报表, after the name of the memory zone. See Report with parameters for more details.
  • ..内存区域名称 used in the code of the report allows you to find out and modify the name of the memory zone associated with the report.
  • ..数据源名称 used in the code of the report allows you to find out and modify the name of the base file of the memory zone associated with the report.

ImportantIn 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.

WinDev

WinDev example

The user selects the customers to whom a promotional offer must be sent. The name of the selected customers is found in the List Box control named "Recipient".

Once all the customers have been selected, the Web user clicks the "BTN_Print" button to print the "RPT_MemZone" report.

During a click on the "Print" button:

  • the memory zone named "MemZone" is created.
  • the record number of each selected customer is retrieved and added to "MemZone".
  • the "RPT_MemZone" report is printed.
  • the memory zone named "MemZone" is deleted.
In this example, the click code of the "BTN_Print" button is as follows:

nSubscript整数型
// Create the memory zone
内存创建"MemZone"
// Browse the Recipient list and initialize the memory zone
对于nSubscript1最优直到Recipient..数目
// Find the current record
H读查找CustomerNameRecipientnSubscript】)
如果H找到Customer)=,那么
// Add the elements into the memory zone
内存添加"MemZone"""H记录号())
结束
结束
// Open the preview window
打印预览()
// Print the report
打印报表RPT_MemZone"MemZone"
// Destroy the memory zone
内存删除全部"MemZone"