1. What is a template Builder?
The Template Builder is an extension to Microsoft Word that simplifies the development of RTF templates. The Template Builder is tightly integrated with Microsoft Word and allows you to perform the following functions:
• Insert data fields
• Insert data-driven tables
• Insert data-driven forms
• Insert data-driven charts
• Preview your template with sample XML data
• Browse and update the content of form fields
• Extract boilerplate text into an XLIFF translation file and test translations
• Insert data fields
• Insert data-driven tables
• Insert data-driven forms
• Insert data-driven charts
• Preview your template with sample XML data
• Browse and update the content of form fields
• Extract boilerplate text into an XLIFF translation file and test translations
Valid template file types are:
eText - Inbound, eText - Outbound, PDF, RTF, XSL-FO, XSL-HTML, XSL-TEXT, and XSL-XML.
2. Sub Template into Main Template:
Import the subtemplate
<?import:file:/// D:\siva\Callsubtempalte\Subtemplatenew.rtf?>
In the subtemplate we are calling
Headers:
<?call@inlines:Tc1?><?with-param:ReportName;string(‘SIVA REPORT’)?> <?end call?>
<?call@inlines:Tc1?><?with-param:ReportName;string(‘SIVA REPORT’)?> <?end call?>
Footers
<?call:Tc2?>
3. Translatable (check box)
Select this check box if you want this template to be translatable. Only RTF templates are translatable. After the template definition is created, the following fields are not updateable: Application, Code, and Type. Update the template from the View Template page.
Select this check box if you want this template to be translatable. Only RTF templates are translatable. After the template definition is created, the following fields are not updateable: Application, Code, and Type. Update the template from the View Template page.
4. To handle parameterized layout
If the requirement is to display a different layout based on a user parameter value or a List of Value selection, then the parameter can be passed to RTF layout and conditionally display the layout.
On the Report Editor you first need to define a parameter with name DeptName. If this parameter has to be associated with a List of Value (LOV), then create a LOV on the Report Editor page.
Next, in the parameter definition select parameter type as “Menu” and then select the LOV from the selection.
In the RTF template define a parameter using syntax - <?param@begin:DeptName?>
Now when user selects a department name from the List of Value on the report viewer page, the value gets passed to RTF layer into the DeptName parameter. To display the layout based on this user selection, you can use an IF statement or a CHOOSE statement to evaluate the parameter value and call the associated sub template.
Use CHOOSE statement when too many conditional tests are to be done and a default action is expected for rest of the values, for example, for each department here we have a different sub template and if the user parameter has a department name with no associated sub template, then a default sub template can be called in otherwise section.
<?choose:?>
<?when:$DeptName=’Accounting’?><?call:tAcc?>
<?end when?>
<?when:$DeptName=’Sales’?><?call:tSales?>
<?end when?>
<?when:$DeptName=’Marketing’?><?call:tMark?>
<?end when?>
<?otherwise:?><?call:tDefault?>
<end otherwise>
<?end choose?>
5. WATERMARK
PAGE LAYOUTàWATERMARK (Word 2007)
Format à Backgroundà Printed Watermark (Word 2003)
6. TEXT FIELD
Developeràcontrolsàlegacy toolsàtext field
7. Add Totalà Sum in calcualtion in a new row.
8. Adding Page/Brought Forward/Carried Forward Total
Placed before the column nameà PT
<?add-page-total:pt;'TRANS_AMOUNT_REMAINING'?>
9. Display Page Total in Footer
<xdofo:show-page-total name="pt" format="99G999G999D00"/>
10. Display Brought Forward Total in Header
<xdofo:show-brought-forward name="pt" format="99G999G999D00"/>
11. Display Carried Forward Total in Footer
<xdofo:show-carry-forward name="pt" format="99G999G999D00"/>
12.
The values for the form fields in the template are shown in the following table:
Form Field | Syntax | Description |
RtotalVar | <?xdoxslt:set_variable($_XDOCTX, 'RTotalVar', 0)?> | Declares the "RTotalVar" variable and initializes it to 0. |
FE | <?for-each:INVOICE?> | Starts the Invoice group. |
10001-1 | <?INVNUM?> | Invoice Number tag |
1-Jan-2005 | <?INVDATE?> | Invoice Date tag |
100.00 | <?xdoxslt:set_variable($_XDOCTX, 'RTotalVar', xdoxslt:get_variable($_XDOCTX, 'RTotalVar') + INVAMT)?> xdoxslt:get_variable($_XDOCTX, 'RTotalVar')?> | Sets the value of RTotalVar to the current value plus the new Invoice Amount. Retrieves the RTotalVar value for display. |
EFE | <?end for-each?> | Ends the INVOICE group. |
12. For loop
<?for-each:G_CUSTOMER?>
<?end for-each?>
13. PAGE BREAK
In order to have different set of page number for each customer’s document you can use a section break.
Double click on the first ‘for-each’ for Customer Name text form.
Change the ‘for-each’ loop to ‘for-each@section’
Example:
Before
<?for-each:G_CUSTOMER?>
After
<?for-each@section:G_CUSTOMER?>
Click OK.
14. CONDITIONAL FORMATTING
The XSL code you need is:
<?if:TRANS_AMOUNT_REMAINING >1000?>
<xsl:attribute xdofo:ctx="block" name="background-color">red</xsl:attribute>
<?end if?>
15. BARCODE
Select File à Properties à Custom Tab
In the Name field enter: xdo-font.Free 3 of 9.normal.normal – notice the name of the font must match the name of the font in the MSWord font drop down
16. SORTING:
<?sort:TRANS_AMOUNT;'ascending';data-type='text'?>
17. DIFFERENT LAST PAGE:
To utilize this feature, you must create a section break in your template to ensure the content of the final page is separated from the rest of the report and Insert the following syntax on the final page:
<?start@last-page:body?>
<?end body?>
<?start@last-page:body?>
<?end body?>
18. CHART
INSERTà CHARTàTYPE/GROUPING/DIMENSION/MEASURE
Follow the following steps to modify the XSL definition.
Double click on the Chart image
Click Web tab
<Cell>
<xsl:value-of select="sum(current-group()/TRANS_AMOUNT)"/>
</Cell>
Change it to
<Cell>
<xsl:value-of select="sum(current-group()//TRANS_AMOUNT)"/>
</Cell>
Notice the extra ‘/’ between ‘current-group() and ‘TRANS_AMOUNT’.
19. Table of Contents/Bookmarks
· Type <?CUSTOMER_NAME?> and remove CUSTOMER_NAME text form, this is because the Table of Content function can not handle the text form.
· Change the font setting for the <?CUSTOMER_NAME?> to be ‘Heading 1’.
· Insert a section break before the first page header so that you will have a blank page as the first page. You can use MS Word’s section break for this. (Insert->Break->Section Break->Next Page)
· Move to the inserted first page and place your mouse cursor into the first page.
· Click Insert from the tool menu and select Reference-> Index and Tables
· Click Table of Content tab and choose how you want to display your Table of Contents
· Click OK.
· Make sure that the table of contents has <?CUSTOMER_NAME?> tag inserted.
Bookmark
- Add the following tag before the table of contents.
<?convert-to-bookmark:?> - Add the following tag after the table of contents.
<?end convert-to-bookmark:?>
20. CROSSTAB
· Create a new RTF template
· Load Crosstab_Sample_Data.xml
· Go to File->Page Setup and choose Landscape as Orientation
· Select Crosstab from the Template Builder tool bar. (Insert->Crosstab)
· Drag and Drop ‘Flows’to data area
· Drag and Drop ‘Bus Grp’ to Row Header area
· Drag and Drop ‘Type’ to Column Header area
· Click OK.
21. Bursting
What is a bursting file ?
Its an XML file which tells bursting engine
Its an XML file which tells bursting engine
a) to split the XML File created.
b) to deliver the Documents.
b) to deliver the Documents.
Advantages of XMLP bursting
a. No Additional Coding, just need to create XML bursting File. ( Isn't it exciting , otherwise we would have to write java program to split the XML File and then use XMLP delivery manager API to send emails .
b. Process of Creating XML data Definition and Template remains AS – IS .
b. Process of Creating XML data Definition and Template remains AS – IS .
22. BLOB & CLOB
- Can’t generate xml data for CLOB more than 40 kb in report builder.
- BLOB Images are supported in XML Publisher 5.6.2 or later.
- Encode BLOB to CLOB use this following function:
CREATE FUNCTION getbase64( p_source BLOB )
RETURN CLOB
IS
v_result CLOB;
BEGIN
DBMS_LOB.createtemporary(lob_loc => v_result, CACHE => FALSE, dur => 0);
Wf_Mail_Util.EncodeBLOB ( p_source, v_result);
RETURN ( v_result );
END getbase64;
- To show BLOB Images use the following code:
<fo:instream-foreign-object content-type=”image/jpg”><xsl:value-of select=”.//IMAGE_”/></fo:instream-foreign-object> - XML Publisher supports in general right now only JPG, GIF and PNG.
Suresh,
ReplyDeleteExpanding off of #13, we have a different first page header (Word functionality) for each separate customer document, but is it possible to have a different last page header for each separate customer? In Word they only give you an option for different first page, but I'm wondering if a different last page can be accomplished? thx. CJB
Regarding #17, we have a transcript template where many documents may be contained in 1 XML file. We use at the very beginning of the document, with at the very end. I put a section break in place, followed by . The text I added after the end body tag prints only once, at the very end of all the documents. I have tried putting the body tags before the end for-each section and after it. Any advice?
ReplyDeleteKlik dulu baru bisa rasakan ayam bangkok
ReplyDeleteTips malam ini sdh ready yah ^^
ReplyDeleteayo bergabung dengan bolavita khusus new member lgsg di berikan 10%
tanpa ribet dan masih banyak bonus2 lain nya
semua di berikan tanpa ribet pelayanan terbaik 24 jam
depo wd secepat kilat ^^ laga ayam bangkok
info lbh lanjut :
WA: +628122222995