| To create a print session for query-based reportsTo create a print session that can print a query-based report,
take the following steps: 步骤 1. Define a print session- Start the
进程 (ttadv2500m000) session. Make sure you select the proper development
VRC as your current package VRC.
- Click New.
The 进程 (ttadv2100s000) details session starts.
- Enter the module and session code and the description for
the new session, and specify the following session properties:
- 标准脚本: No
- Generate Script: No
- 程序脚本: <The program script's code,
consisting of package code, module code and the first 4 characters of the
session code.>
- Main Table: <Empty>
- 进程类型: Print
- 窗口类型: Dialog
- Main Session: Yes
- Synchronized Dialog: <Empty>
For the other fields, use the default values. - Save the new session and close the
进程 (ttadv2100s000) details session.
- In the
进程 (ttadv2500m000) overview session, click
编译.
步骤 2. Link a query-based report to the session- In the
进程 (ttadv2500m000) session, select the new session and, on the
相应 menu, click
Reports.... The
Reports (ttadv3530m000) session starts.
- Click New. The
Add Report to Session (ttadv2112s000) session starts.
- Enter the report group and the serial number. Select the
desired report and click OK.
- Save the changes and close the
Reports (ttadv3530m000) session.
步骤 3. Edit the session's UI script- In the
进程 (ttadv2500m000) session, select the new session and, on the
相应 menu, click
Program Scripts.... The
Program Scripts / Libraries (ttadv2530m000) session starts.
- Select the script and click
Edit / View Script .... The script editor
starts.
- Edit the script. For example:
- Declare the variables you want to use as input fields
on the session's form. Note: the variable names must be identical to the
variable names you defined in the
Reporting Studio.
- Define defaults for the input fields on the
form.
See the following sample UI script. - Save the script and close the editor.
- Compile the script and close the
Program Scripts / Libraries (ttadv2530m000) session.
Sample UI script:
declaration:
extern domain ttaad.pacc pack_from fixed
extern domain ttaad.pacc pack_to fixed
extern domain ttyeno incl_pack | print packages y/n
|**************************** field sections ***********************************
field.pacc_from:
before.zoom:
ttaad120.pacc = ""
when.field.changes:
pack_to = pack_from
display("pack_to") |#icc2.6.n
field.pacc_to:
before.zoom:
ttaad120.pacc = pack_from
The sample script belongs to a session that prints the
package combinations, and optionally, the corresponding package VRCs. Points of
attention: - The pack_from and pack_to variables are used as input
fields in the form, to enter the selection range. In the report design in
Reporting Studio, pack_from and pack_to are mapped to parameters "1" and "2"
that are used in the query's between statement (
between :1 and :2 ). - The incl_pack variable is used as an input field on the
form. The value entered by the user (Yes or No) determines whether the packages
are printed. In Reporting Studio, the incl_pack variable is used in a print condition. Based on
the value of incl_pack, the detail that contains the package VRCs is printed or
suppressed.
步骤 4. Design the session's form- In the
进程 (ttadv2500m000) session, select the new session and click
Edit Form .... The 动态表格编辑器 starts.
- Edit the form: Add form fields for the input variables you
defined in the UI script, and customize the structure of the form until it
matches the requirements. See the following figure for an example.
- Save the form and close the editor.
- In the
进程 (ttadv2500m000) session, click
编译.
| |