This section describes how to add the following page features to the PDF layout.
To add page numbers, define a field in the layout where you want the page number to appear and enter an initial value in that field.
To add page numbers:
You can define a page break in the layout to occur after a repeatable field.
To insert a page break after the occurrence of a specific field, add the following to the syntax in the Tooltip field of the Text Field Properties dialog:
page_break="yes"
For example:
<?rep_field="T1_G3", page_break="yes"?>
The following example demonstrates inserting a page break in a layout. The XML sample contains salaries of employees by department:
<?xml version="1.0"?> <ROOT> <LIST_G_DEPTNO> <G_DEPTNO> <DEPTNO>10</DEPTNO> <LIST_G_EMPNO> <G_EMPNO> <EMPNO>7782</EMPNO> <ENAME>CLARK</ENAME> <JOB>MANAGER</JOB> <SAL>2450</SAL> </G_EMPNO> <G_EMPNO> <EMPNO>7839</EMPNO> <ENAME>KING</ENAME> <JOB>PRESIDENT</JOB> <SAL>5000</SAL> </G_EMPNO> <G_EMPNO> <EMPNO>125</EMPNO> <ENAME>KANG</ENAME> <JOB>CLERK</JOB> <SAL>2000</SAL> </G_EMPNO> <G_EMPNO> <EMPNO>7934</EMPNO> <ENAME>MILLER</ENAME> <JOB>CLERK</JOB> <SAL>1300</SAL> </G_EMPNO> <G_EMPNO> <EMPNO>123</EMPNO> <ENAME>MARY</ENAME> <JOB>CLERK</JOB> <SAL>400</SAL> </G_EMPNO> <G_EMPNO> <EMPNO>124</EMPNO> <ENAME>TOM</ENAME> <JOB>CLERK</JOB> <SAL>3000</SAL> </G_EMPNO> </LIST_G_EMPNO> <SUMSALPERDEPTNO>9150</SUMSALPERDEPTNO> </G_DEPTNO> <G_DEPTNO> <DEPTNO>30</DEPTNO> <LIST_G_EMPNO> . . . </LIST_G_EMPNO> <SUMSALPERDEPTNO>9400</SUMSALPERDEPTNO> </G_DEPTNO> </LIST_G_DEPTNO> <SUMSALPERREPORT>29425</SUMSALPERREPORT> </ROOT>
Suppose the report requirement is to display the salary information for each employee by department as shown in the following figure:
To insert a page break after each department, insert the page break syntax in the Tooltip field for the SUMSALPERDEPTNO field as follows:
<?rep_field="T1_G3", page_break="yes"?>
The Text Field Properties dialog for the field is shown in the following figure.
Note that in order for the break to occur, the field must be populated with data from the XML file.
The sample report with data is shown in the following figure:
The page breaks after each department.