PC SOFT

WINDEV的在线文档

  • Principle for printing a report
  • Report with lower and upper bounds
  • Running a query and report based on this query
  • Destination of the print
  • Passing parameters
  • Printing a component report
  • RPC and independent HFSQL context
  • Nested reports
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系: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本地访问

Prints a report created in the report editor.

Caution: The WLanguage code required to print the report depends on the data source of the report. For more details and examples, see:

15版本和更高版本
Linux The reports are available in PDF format in Linux. See Printing in Linux for more details.
15新版本
Linux The reports are available in PDF format in Linux. See Printing in Linux for more details.
Linux The reports are available in PDF format in Linux. See Printing in Linux for more details.

ImportantWith Reports & Queries, you have the ability to print a report:
  • by starting a print ().
  • by running the report test ().
Therefore, no programming is required to print the report.

In order for the reports created in Reports & Queries to be directly printed from a WinDev application, this feature must be implemented by the provider of the WinDev application.

The provider can for example include a window allowing the end user to:

  • select a report created in Reports & Queries.
  • run this report.

Note: From version 19, HFSQL is the new name of HyperFileSQL.
例子
// Simple print on printer
打印报表RPT_Invoice

WinDev用户代码(MCU)
// Print with print preview
打印预览打印.百分百
打印报表RPT_Invoice

语法
 [<Result> =] 打印报表(<Report Name> [, <Parameter 1> [, <Parameter 2> [, ...]]])
<Result>: Type of result returned by the report (optional)
20版本和更高版本
Value returned by the report when it is printed. This value is returned:
20新版本
Value returned by the report when it is printed. This value is returned:
Value returned by the report when it is printed. This value is returned:
<Report Name>: Character string (with or without quotes)
  • Logical name of the report, defined in the report editor.
  • Physical name of the report (including its path) if the compiled code is included in the report.
<Parameter 1>: Optional parameters (the type corresponds to the type of the parameter)
Optional parameter expected by the report. This parameter was defined in the opening code of the report. This parameter can be the name of a view, the name of a memory zone, etc.
Caution: If lower bounds and upper bounds have been specified for the report, the first two parameters must correspond the lower bound and to the upper bound (respectively).
<Parameter 2>: Optional parameters (the type corresponds to the type of the parameter)
Optional parameter expected by the report. This parameter was defined in the opening code of the report. This parameter can be the name of a view, the name of a memory zone, etc.
Caution: If lower bounds and upper bounds have been specified for the report, the first two parameters must correspond the lower bound and to the upper bound (respectively).

注意

Principle for printing a report

打印报表 reads the data source of the report (data files, query, Table control, ...). 打印报表 prints the Body block for each record. The other blocks are printed when necessary:
  • The Start of document block will be printed at the beginning of the document.
  • The End of document block will be printed at the end of the document.
  • The Page header block will be printed at the top of each page.
  • The Page footer block will be printed at the bottom of each page.
  • If there is a break, the Body block of the break will be located between the Break header block and the Break footer block.

Report with lower and upper bounds

If lower and upper bounds have been specified when the report was created in the report editor, the two first parameters passed to the report via 打印报表 must correspond to the lower bound and to the upper bound (respectively).

Running a query and report based on this query

When printing a report based on a query, the query is not re-run if it was already run. To force the re-execution of the query (adding records for example), all you have to do is use H执行查询 or 打印初始化报表查询.

Destination of the print

The destination of the report print can be configured by 打印预览 and 打印目标.

WinDev 打印预览 is used to perform a print preview. To find out whether the print was performed from the preview, use 打印已请求.

WinDev用户代码(MCU)

Passing parameters

The parameters specified by 打印报表 correspond to the parameters defined in the opening code of the report via the following syntax:

PROCEDURE <ReportName> (<NameParam1>, <NameParam2> = "<DefaultValue>", ...
<NameParamN> = "<DefaultValue>")

Reminder: Some of the parameters passed to a procedure can be optional parameters. When declaring the procedure, the optional parameters must be described in last position (on the right), with a default value preceded by the "=" sign. See Parameter of a procedure for more details.

If the report is based on a query, you will have to use 打印初始化报表查询 to pass the query parameters before printing the report.

Printing a component report

To print a component report, use the name of the component report (the component being included in the project). For example:

打印报表ComponentReport

If a conflict occurs with a project element, the name of the element must be prefixed by the name of the component. For example:

打印报表MyComponent.Report

To use the name of the report in a variable, specify the name of the component. For example:
sReport字符串型"MyComponent.MyReport"
打印报表sReport

WinDev用户代码(MCU)

RPC and independent HFSQL context

The access to a HFSQL data file in RPC is not allowed from a report with an independent context.

The "Independent HyperFileSQL context" option must be disabled.

To disable this option in a report, uncheck "The report execution does not affect the browse operations (independent HyperFileSQL context)" in the "Data" tab of the report description.

The "Independent HFSQL context" option must be disabled.

To disable this option in a report, uncheck "The report execution does not affect the browse operations (independent HFSQL context)" in the "Data" tab of the report description.

In an application that is using the remote access, if independent contexts must be used, they must be programmed by H保存位置 and H还原位置.

Note: The contexts cannot be copied in RPC. You must use H打开数据模型 or H连接远程访问 in the new context to access the RPC.

Nested reports

You have the ability to call 打印报表 within the same report. See the help about the Nested reports for more details.

组件
WinDev wd200etat.dll
Linux wd200etat.so