Search This Blog

Monday 11 February 2013

Custom variables in RTF template in XML


Custom variables in RTF template


Custom variables in RTF template is nothing but declaring a variable in one group and using that variable in another group which is shown below.Our RTF looks

XML output for above RTF is

Here we are going to declare one custom variable in parent group by taking one form filed which is shown below



Now add one more column to the RTF for displaying running totals as shown below.
Place the cursor in Inv_Amt column Right click to create one more column.
Click ok.
Do the same step to create one more cell .
Give the name of the column and take one form field which is shown below
Click ok.
Now our RTF looks

Now we have to publish the report

Click on Template Builder => Preview => HTML/PDF/Excel/RTF (any format).
We can get below output


Page breaks in XML


Page breaks


Here we are using the template which we had used in the lesson Understanding XML and identifying Groups of repeating elements.
Our RTF looks

If we execute the above RTF or publish the above report we can see below output

By seeing above output we can say that All Vendors Invoices is coming one after the other in the same page.
If we want to display each vendor invoices in each page and another vendor invoices in the next page then we can go to page break.

Syntax for page break is: -
<?split-by-page-break:?>

We should have to use the page break before closing the parent group which is shown below.
For that we have to place one form field before parent group which is shown below


Provide proper default text and in the Add Help Text we are going to write below command
<?split-by-page-break:?>
Which is shown below
Click on ‘OK’.

Now we have to publish the report

Click on Template Builder => Preview => HTML/PDF/Excel/RTF (any format).
We can get below output


From the above output we can see that only one vendor invoices got in the output.

In the Next page

From the above output we can say that another vendor invoice output in the next page.


In this way we can use page break