Oracle BI Publisher

RTF Template Development Tutorial
Author: Tim Dexter/Kanichiro Nishida Last Updated: July 14, 2009

Page 2 of 20

Contents
Oracle BI Publisher ..............................................................................................................................................1 RTF Template Development Tutorial................................................................................................................1 Contents........................................................................................................................................................2 Customer Balance Report Tutorial.......................................................................................................................3 Step 1: Load Sample XML Data........................................................................................................................3 Step 2: Insert address block and report level dates and totals..........................................................................3 Step 3: Preview Template.................................................................................................................................3 Step 4: Insert a table of Invoices.......................................................................................................................4 Step 5: Number & Date Formatting ..................................................................................................................6 Number formatting.........................................................................................................................................6 Date formatting..............................................................................................................................................7 Step 6: Dressing Up..........................................................................................................................................7 Headers and Footers.....................................................................................................................................7 Images..........................................................................................................................................................8 Page Numbering...........................................................................................................................................8 Step 7: Adding Total ........................................................................................................................................9 Adding Total..................................................................................................................................................9 Step 8: Adding Page/Brought Forward/Carried Forward Total .........................................................................9 Step 9: Adding Running Total ........................................................................................................................11 Step 10: For loop............................................................................................................................................12 Step 11: Page/Section Break..........................................................................................................................12 Step 12: Conditional formatting ......................................................................................................................13 Step 13: Adding a barcode..............................................................................................................................13 Step 14: Sorting..............................................................................................................................................14 Step 15: Different Last Page...........................................................................................................................15 Step 16: Chart.................................................................................................................................................15 Step 17: Add Table of Contents or Bookmark!................................................................................................17 Table of Contents........................................................................................................................................17 Step 17: Add Table of Contents or Bookmark!................................................................................................18 Bookmark....................................................................................................................................................18 Step 17: Crosstab...........................................................................................................................................19 ........................................................................................................................................................................20 Conclusion .....................................................................................................................................................20

Microsoft EXCEL (EXCEL) or a browser (HTML). you may want to test your template. such as the customer name and address at the header of the letter. make sure that you have installed BI Publisher Desktop Add-in. Step 2: Insert address block and report level dates and totals You may want to select single data fields. You may also insert the remaining address fields (such as Address Line1. It will use the following two sample data XML files AR_SAMPLE_DATA. you should use Insert Fields only for data fields that are unique (not repeating) in your document. From the Insert menu select Field… to open the dialog window shown below. Step 1: Load Sample XML Data From the Data menu select Load XML Data to load a sample XML document that contains the data fields you may want to insert into your RTF layout template. Position the cursor in the Word document where you want to insert the Address. . City. Select the XML data file called AR_SAMPLE_DATA.xml AR_Sample_Data. Note: As a beginner. Crosstab_Sample_Data.xml is required only for Crosstab training. Microsoft Word file (RTF). You can preview the output in Adobe Acrobat Reader (PDF). State and Zip).Page 3 of 20 Customer Balance Report Tutorial This tutorial describes how you would typically create a layout template for the Receivables Customer Balance Report. You can also just drag the Customer Name field from the dialog and drop it into the Word document.xml is required for most of the training steps in this tutorial. Before you start the following set of training steps.xml Crosstab_Sample_Data. Select the field Customer Name and click Insert to insert a form field for the customer name into the document.xml. Oracle BI Publisher Template Builder allows you to preview your template with your sample XML data. Refer to the “Insert Table” section for additional information on how to insert repetitive fields Step 3: Preview Template After adding fields to the document.

0 or higher installed to preview documents in PDF format. Transaction Date is also called a child node of G Invoices. the dialog box should now look like this: . When you select the "G Invoices" node.html. G Currency and G Invoices are all nodes. The document should include a table of all invoices that are not or only partially paid. Push the left mouse button and drag the G Invoices element over to the center Template tree view. For example. Customer Name. When you drop an element with children (other elements below the element). On the Insert menu select Table/Form > Advanced to open the Table/Form Dialog The following dialog will be displayed:   Scroll in the left Data Source view pane until you see the G Invoices element. The preview should show Vision Corporation instead of the field Customer Name.adobe.Page 4 of 20 From the Preview menu select HTML to preview your template in a browser.com/products/acrobat/readstep2. To add multiple nodes. You must have Adobe Acrobat Reader version 5. the following pop-up dialog appears:  Note: A Node is a term used in tree views for an element in the tree view. Instead. You can download Acrobat Reader for free at http://www. the Template Builder offers an additional function that generates a table for you. From the Preview menu select PDF to preview your document in Acrobat Reader. Step 4: Insert a table of Invoices You can build a table or a repeating section by inserting the elements and then adding additional form fields with processing instructions (for-each). click Drop All Nodes with the left mouse button. and G Invoices is referred to as a parent node of Transaction Date.

Grouping: Grouping is an advanced operation that allows you to re-group the data – for example by transaction date instead of currency. Transaction Date. The Properties region on the right shows how the data fields will be formatted. You should see the following information:   For each group you can set the following properties that describe how a group (such as G Invoices) should be rendered by the template builder: Style: Select Table to create a table around the data fields. Repeat the procedure for the other fields that you do not want to be included in the table (as shown in the screenshot below). . You should now click again on the G Invoices element in the center view. Trans Type. and Trans Amount Remaining.Page 5 of 20   We only want to show the fields Trx Number. Trans Amount. Please refer to the Oracle BI Publisher User’s Guide for additional information on grouping. You can select the element that the data should be grouped by for this property. Select the field Receipt Amount in the center view and press the Delete button on your keyboard.

if the associated data element G_INVOICE is found repetitively in the data. Sort Data Type: If you have selected an element for Sort By the data is by default sorted as Text. If you need to sort numbers you should select Number as the sort data type Break: This property allows you to insert a page break or a section break between every data group. A section break allows changing the header/footer and resets the page number. this time try PDF as an output. If you select New Page per Element. a section break will be created for each data group. If you want to reorder the columns you need to change the Insert Position box from Child to Same Level. Number formatting Select the TRANS_AMOUNT field.Page 6 of 20 Show Grouping Value: This property will only be shown if you have selected a node created by the Grouping functionality. then the data groups will be shown continuously with no break. then a page break will be inserted between each element. If you remove one of these processing instructions your template may not work anymore with BI Publisher. Click the OK button to create the table. The foreach G_INVOICES and end G_INVOICES form fields indicate a repeating section. Please refer to the Oracle BI Publisher User’s Guide for additional information on form fields. right-click and select Properties to see the Text Form Field Options dialog. . Sort By: You can select an element by which the data groups are sorted. You will typically use this option. if the data should be sorted either ascending or descending. Sort Order: If you have selected an element for Sort By you can select. if you want to print multiple documents (for example invoices or purchase orders) to a single PDF file. You can also move fields around as long as you keep them in the surrounding for-each G_INVOICES and end G_INVOICES processing instruction. The section of the document encapsulated by these two form fields is repeated. The inserted table should look like this: Trx Number for-each G_INVOICES TRX_NUMBER Trans Type TRANS_TYPE Transaction Date TRANSACTION_DATE Trans Amount TRANS_AMOUNT Trans Amount Remaining TRANS_AMOUNT_REMAININ G end G_INVOICES The Template Builder creates two kinds of form fields:   Form fields representing data elements Form fields with processing instructions for repeating table rows or document section Form fields representing data elements are replaced with the data when the template is processed. If nothing is select. Step 5: Number & Date Formatting You probably would like to change the alignment of the table columns or change the data type and format for the amounts and dates. Then drag the elements into the correct order. That means that 12 will be shown after 111. You can now format these elements in Microsoft Word and add additional text. If you select New Section per Element. The order in which the data elements are shown reflects the order of the columns in the table. You now can preview the template again to review your current template. You can choose for a group if the Data Field node used as a grouping criterion is shown in the table or form.

Make that to be bold and center alignment. display auto shapes or have conditions that you want to write by using the text form. #. Type <?start:body?> before CUSTOMER_NAME text form. etc. Now preview your template again to see the date and number formatting in action. We will use the BI Publisher’s header/footer tags for this exercise. From the right click menu choose ‘Borders and Shading’ and make all the grid and table frame lines not to be displayed. If the date is not in this format then BI Publisher will be unable to format it further. <?start:body?> and <?end body?>.g. Step 6: Dressing Up Headers and Footers You will have noticed by now that you can use the MSWord header and footer functionalities. Choose 3 columns and 1 row for the each table. It should be noted here that BI Publisher is expecting the date data as an XSD format date (Canonical Date Format) e. You can place a company logo. Type ‘Customer Balance Report’ in the central column of the header table.0. 4.Page 7 of 20 You may select the Number in the Type field. Insert a table in the header before the <?start:body?> tag and another table after the <?end body?> tag. . so if you have such requirements that you need to. so we’ll use a table in the header section and another table in the footer section. and also you can place a BI Publisher’s boilerplates to display data in the header and footer in the generated reports. and the between the two tags would be body content area. Date formatting To format the date. Anything before <?start:body?> tag would be considered as header area and after <?end body?> would be as footer area. in the header and in the footer. for example. Formatting options defined in this dialog box are understood by Oracle BI Publisher and used to format your fields. 2006-09-01 00:00:00. Then select the date format you want to use. 3. then you can use BI Publisher’s tag. report title. (You can use a text form to have this tag as well. 1.) 2. open the form field dialog for the TRANSACTION_DATE and specify that it is a Date field. and type <?end body?> after the table.##0. Also it’s a best practice to use a table component to control the layout. Only one problem is that MS Word doesn’t let you place text form fields nor auto shapes in the area.00 for Number format and enter 1000 as the Default Number to achieve a more desirable format for currencies in US Dollar. and page numbering.

Customer Balance Report <?start:body?> CUSTOMER_NAME ADDRESS_LINE1 CITY. 2. Page Numbering You can use the MSWord autotext ‘Page X of Y’ and other auto text objects if you use MSWord’s native header and footer functionalities. font size. ZIP Trx Number F TRX_NUMBER Trans Type TRANS_TYPE Transaction Date TRANSACTION_DATE Trans Amount TRANS_AMOUNT Trans Amount Remaining TRANS_AMOUNT_RE MAININGF 8 of 20 <?end body?> Draft BI Publisher supports many of the MSWord native functions so spend some time changing the look and feel of your report using the MSWord dialogs.Page 8 of 20 5. STATE. But we still can display such page number. Choose ‘Field’ from ‘Insert’ tool bar menu and select ‘NumPages’ and place it right after the ‘of’. Make that to be bold and center alignment. 1. 4. Make the cell to be right alignment Now your template should look like this. etc… . Let’s insert Oracle company logo in the header region. font color. Type ‘of’ after the ‘Page’ field. Place a cursor into the most right cell and choose ‘Field’ from ‘Insert’ tool bar menu and select ‘Page’. table color. otherwise download it from the files online folder. instead we’re using BI Publisher’s tags to support the header and footer. Customer Balance Report <?start:body?> CUSTOMER_NAME ADDRESS_LINE1 CITY. For example. You should have downloaded the file called company_logo.png onto your local machine by now. table lines. STATE. Type ‘Draft’ in the central column of the footer table. etc. But this time we’re not using that. Now your template should look like this. ZIP Trx Number F TRX_NUMBER TranADDRES S_LINE1s Type TRANS_TYPE Transaction Date TRANSACTION_DATE Trans Amount TRANS_AMOUNT Trans Amount Remaining TRANS_AMOUNT_RE MAININGF <?end body?> Draft Images It’s a simple case of using the Insert>Picture> From File to insert an image into the header/footer or main region of the report. 3.

So it would look like this. too.Page 9 of 20 Step 7: Adding Total Adding Total Now you want to see the total amount of the whole transactions amount. Insert another text form into TRANS_AMOUNT_REMAINING column’s cell of the main table. <?add-page-total:pt. click ‘Add Help Text’ and type the following in the box. Trx Number F TRX_NUMBER Trans Type TRANS_TYPE Transaction Date TRANSACTION_DATE Total: Trans Amount TRANS_AMOUNT sum TRANS_AMOUNT Trans Amount Remaining TRANS_AMOUNT_REMAINING E sum TRANS_AMOUNT_REMAINING Step 8: Adding Page/Brought Forward/Carried Forward Total In this exercise we also want to display page total. 2. brought forward total and carried forward total of the transaction amount in each page. we will put the brought forward total in header area and the carried forward total in footer area. you’ll add another row at the last row of the table so that you can display total amount of the whole transaction at the last row of the table. Double click on the text form and type ‘PT’ as a default value. 1. The brought forward total is a total amount of the previous page that is forwarded to the current page while the carried forward total is a total amount of the current page that is carried to the next page. . Click Insert from Template Builder tool bar menu and choose Field 2. place it right before the TRANS_AMOUNT_REMAINING text form. Click Insert button You can add another SUM Total for TRANS_AMOUNT_REMAINING. In this tutorial. Select TRANS_AMOUNT element and choose ‘SUM’ as a calculation 3. Set Page Total 1. Click OK. This would be very simple. Since we want to display these total values in every page. 3.'TRANS_AMOUNT_REMAINING'?> 4.

Type ‘Page Total’ in Default Text field and click OK. Double click on the text form and click ‘Add Help Text’ and type the following in the box. 6. 2. Customer Balance Report Brought Forward Total: Forward Total 10 of 20 . 5. 4. Type ‘Carried Forward Total:’ and select right alignment in the central cell of the footer table. <xdofo:show-brought-forward name="pt" format="99G999G999D00"/> 7. Double click on the text form and click ‘Add Help Text’ and type the following in the box. Insert an additional row under Page Total row in the Footer table 2. 3. Note that you need to specify a number format in the xdofo tag and MS Word number formatting functionality can not be used.Page 10 of 20 Trx Number F TRX_NUMBER Trans Type TRANS_TYPE Transaction Date TRANSACTION_DATE Total: Trans Amount TRANS_AMOUNT sum TRANS_AMOUNT Trans Amount Remaining PTTRANS_AMOUNT_REMAINI NG E sum TRANS_AMOUNT_REMAINING Display Page Total in Footer 1. Type ‘Page Total:’ and select right alignment in the central cell of the footer table. 3. Page Total: Draft Page Total Display Brought Forward Total in Header 1. 2. Insert a row below the existing one in a header table Select the entire row and select ‘Boarders and Shading’ from right click menu Under Boarder tag. <xdofo:show-carry-forward name="pt" format="99G999G999D00"/> 5. Type ‘Carried Total’ in Default Text field and click OK. Place mouse cursor at the right cell of the table and click ‘Text Form Field’ icon from the tool bar to insert a Text Form. Place mouse cursor at the right cell of the table and click ‘Text Form Field’ icon from the tool bar to insert a Text Form. Customer Balance Report Brought Forward Total: Forward Total 10 of 20 Display Carried Forward Total in Footer 1. Place mouse cursor at the right cell of the table and click ‘Text Form Field’ icon from the tool bar to insert a Text Form. <xdofo:show-page-total name="pt" format="99G999G999D00"/> 5. set a boarder line for the bottom and click OK. Insert a row above the existing row in the Footer. 3. 4. Type ‘Brought Forward Total:’ and select right alignment in the central cell of the header bottom line. Page Total: Carried Forward Total: Draft Page Total Carried Total And now you should have something like this. Double click on the text form and click ‘Add Help Text’ and type the following in the box. Type ‘Forward Total’ in Default Text field and click OK. 4.

Click ‘Add Help Text’ and type the following. and add the current value to whatever the value has been added at the previous cell. Double click the text form and type ‘Set’ as the default text. 7. 6. 2. 0)?> 4. so by this point your report should look like this.) <?xdoxslt:set_variable($_XDOCTX. This requires a little trick. Click OK. it’s very exciting one! It’s a running total that will keep adding the previous value to the current value when it goes down the cells so the very last value should be the same as a total value. but once you understand it.'RT')?> 14. and select ‘#. which has been set by the functions that are set in ‘Set’ text form. we’re almost done for this total stuff! Just one more.Page 11 of 20 <?start:body?> Trx Number F TRX_NUMBER Trans Type TRANS_TYPE Transaction Date TRANSACTION_DATE Trans Amount TRANS_AMOUNT Trans Amount Remaining PT. Add a column to the right of Trans Amount Remaining and name the column header as Running Total. so hope you can make all the above steps set right.00E sum TRANS_AMOUNT_REMAINING <?end body?> . Click ‘Add Help Text’ and type the following. so it might sound a bit complicated. TRANS_AMOUNT_REMAINING E sum TRANS_AMOUNT_REMAINING <?end body?> Page Total: Carried Forward Total: Draft Page Total Carried Total Step 9: Adding Running Total Ok. 5. Click OK.) <?xdoxslt:get_variable($_XDOCTX. 13. TRANS_AMOUNT_ REMAINING Running Total Set999. Customer Balance Report Brought Forward Total: <?start:body?>       Trx Number F TRX_NUMBER Forward Total 11 of 20 Trans Type TRANS_TYPE Transaction Date TRANSACTI ON_DATE Trans Amount TRANS_AMOUN T Trans Amount Remaining PT.##0. Insert a Text Form in the Running Total’s cell. 12. Insert a Text Form at the beginning of the body space.00’ as the default text. and set the accumulated value to the RT variable.'RT'. xdoxslt:get_variable($_XDOCTX. Ok. Double click the text form and change Type to ‘Number’ and type ’999. 11.'RT') +TRANS_AMOUNT_REMAINING)?> 10. <?xdoxslt:set_variable($_XDOCTX.00’ as the number format. 3. Click OK. Insert a Text Form right after the ‘Set’ text form. (this part gets the last value and add the current value to it. Click ‘Add Help Text’ and type the following. 8. (this part just displays the current accumulated value. 1.'RT'. it’s pretty straight forward! Basically what you need to do is to define a variable. Cut and past <?end for-each?> tag from the Trans Amount Remaining cell to the added cell so that it will be the last tag in the row of the table. 9. Double click on the text form and type ‘RT’ as the default text.

some of the customers information is displayed across the pages and starts at the middle of the page. And you can input the following. <?end for-each?> And at this point. TRANS_AMOUNT_RE MAINING Running Total Set999. Customer Balance Report <?start:body?> FCUSTOMER_NAME ADDRESS_LINE1 CITY. so let’s remove them just to make it simple. so you need to insert another text form field to input the following. which means that you want to have each customer data started at the top of the page so that you can separate each customer’s data into different documents and send them to each customer. <?for-each:G_CUSTOMER?> As any other programming would do the same. and double click the filed to open a dialog and click on ‘Add Help Text…’ button. Place your mouse cursor between sum TRANS_AMOUNT_REMAINING and EF 2. But you might want to create it as multiple documents in one report book. 1. you need to close the for-loop. The easiest way to achieve this is to insert a page break.Page 12 of 20 Page Total: Carried Forward Total: Draft Page Total Carried Total Step 10: For loop Now you might have already noticed that your report displays invoice information only for one customer but when you look into the XML data file there is much more customers information! This is because now you have only one ‘for loop’ that is used for G_INVOICE node. Select Insert from Word tool bar and select ‘Break…’ menu. choose ‘Page Break’ and click OK. Double click on the first ‘for-each’ for Customer Name text form. ZIP       Trx Number Trans Type F TRX_NUMBER TRANS_TYPE 12 of 20 Transaction Date TRANSACTION_DATE Trans Amount TRANS_AMOUNT Trans Amount Remaining PT. . In order to have different set of page number for each customer’s document you can use a section break. having the brought forward and carried forward doesn’t really make sense anymore. However. You can simply insert a text form field by clicking text form field button into right before CUSTOMER_NAME filed. 1. STATE. for example. as you might notice it the page number is still continuous across pages so when you separate each customer’s document the page number wouldn’t make sense.00E sum TRANS_AMOUNT_REMAINING EF <?end body?> Draft Step 11: Page/Section Break Now your report displays all the customer’s transaction data as one document. In order to display multiple customer information you need to have another for-loop at G_CUSTOMER level. So now it should look like the below.

Try Preview and make sure that your report displays customer data per customer and each customer section always starts from the top page. This will override any other background color that may have been set. Install the Customer Balance Template/FREE3OF9. Now you need to define a mapping by creating a custom document property.c:\windows\fonts\FREE3OF9.ttf .000. Let’s assume we want to use a red background on any amount remaining that is greater than $10000. 5.normal – notice the name of the font must match the name of the font in the MSWord font drop down 3.’ Insert the following tags. 3. the font will now be available from the font drop down list. If it’s over 1. Now restart MSWord. 4. Step 12: Conditional formatting You can highlight certain values in your invoice table. In the Value field enter: truetype. To achieve this we need to add some XSL code to check the value and set the background color to be red if the value is greater than 10000. 2. Highlight the fields or text you want and select the barcode font. Insert a text form right before TRANS_AMOUNT_REMAINING Double click on the text form Type ‘Red’ as a default text Click ‘Add Help Text.Page 13 of 20 2. 1. Change the ‘for-each’ loop to ‘for-each@section’ Example: Before <?for-each:G_CUSTOMER?> After <?for-each@section:G_CUSTOMER?> 3.normal. <?if:TRANS_AMOUNT_REMAINING >100000?> <xsl:attribute xdofo:ctx="block" name="background-color">red</xsl:attribute> <?end if?> This tests the amount remaining value. In the Name field enter: xdo-font. Click OK. Step 13: Adding a barcode To add a barcode you’ll first need one. Also the page number starts with each customer and the total number of the pages are the number of pages for each customer’s.Free 3 of 9. Select File  Properties  Custom Tab 2..000 then the background color attribute is set to red. The XSL code you need is: <?if:TRANS_AMOUNT_REMAINING >10000?> <xsl:attribute xdofo:ctx="block" name="background-color">red</xsl:attribute> <?end if?> Step: 1.ttf font into your WINDOWS_HOME/fonts directory.

ascending and descending. which means from the lowest to the highest. 1. 120. Now test your template using the Preview function and you should see the barcode rendered based on the data. . We don’t go through that for this training but you can find the detail information how to set the font information in User’s guide.data-type='text'?> Trx Number F TRX_NUMBER Trans Type TRANS_TYPE Transaction Date TRANSACTI ON_DATE Trans Amount TRANS_AMOUN T Trans Amount Remaining PT. which probably would be most of the cases. When you preview at this point you’ll notice that the data is sorted based on the TRANS_AMOUNT value but it’s not quite right. BI Publisher supports a sorting function in the both ways. For example. If you need to run the report at a different machine. First.00 although the sorting order should be ascending. not the number value base. you can find the sorting tag. This works fine as long as you generate the report on your local machine. then you need to set such font configuration information. Step 14: Sorting Now you want to display the transaction data from the lowest to the highest based on the transaction amount.20 is displayed before 12. You can change the ‘data-type=’text’ to ‘datatype=’number’.375. This is because now the sorting is done based on the text value base sorting. Double Click on the text form for ‘G_INVOICES’ for-each loop. REDTRANS_AMOU NT_REMAINING Running Total Set999. Add the following <?sort:TRANS_AMOUNT. you need to specify on which data you want to sort and select whether ascending or descending. which is right before TRX_NUMBER 2.653.00E (Double click on ‘F’ text form right before the TRX_NUMBER. but note that it means it wouldn’t work when you try to generate the report at a different machine unless the barcode font has been installed and the appropriate font mapping has already been defined. for example at a server. then you’ll see the data is now sorted by TRANS_AMOUNT number value.'ascending'.Page 14 of 20 4.

The following is the steps to insert a chart that shows customer’s transaction amount per customer in vertical bar graph. Add another row in a table in the footer. 2. BI Publisher provides this ability. Type ‘Trans Amount Remaining Total’ in the right cell. 3. Copy the header and footer content from the first page and paste them to each of the header and footer area in the second page. Move to the page. This is useful for documents such as checks. Before you start the following steps. To utilize this feature. 5. and select ‘Next Page’ under ‘Section Break Type’ Now you see another one page has been added. any desired headers or footers previously defined for the report must be reinserted on the last page. even you’re experienced but still!) you might get overwhelmed by this. 6. Click ‘Insert’ from Template Builder menu and select ‘Field’. look at a customer. Click Insert from tool bar and choose Break. (well. which has 2 pages of the report. note that because this command explicitly specifies the content of the final page. the first is to insert a dummy image and the second is to define BI Beans Graph XML in Alternative Text area under Web tab of Format Picture dialog. Customer Balance Report Brought Forward Total: <?start@last-page:body?> <?end body?> Trans Amount Remaining: Page Total: Carried Forward Total: Draft TRANS_AMOUNT_REMAINING Page Total Carried Total Forward Total 15 of 20 Step 16: Chart To add a chart basically you need to do these 2 steps. 1. only in the last page. Drag and Drop ‘CUSTOMER_NAME’ element from the left tree pane to Labels.Page 15 of 20 Step 15: Different Last Page BI Publisher supports different last page header/footer or content. so that you have the sum of Trans Amount Remaining in the right cell right after ‘Remaining Transaction Amount Total:’ 10. Also. Try Preview to see the result You will notice that all the pages show total amount of Trans Amount Remaining in the footer area except for the first page for the customer that goes across more than one page. 4. 8.-) The second page should look similar to this. . <?start@last-page:body?> <?end body?> 7. You’ll see that there is no Trans Amount Remaining total displayed in the footer area in the first page and only the second page has the Trans Amount Remaining total displayed in the footer. which you have done it at Step 11. But don’t worry! there is a Chart creation tool that can be accessed by the template builder tool menu. or purchase orders on which you may want certain content. invoices. Especially if you’re just starting. 9. you need to take the section break out from the ‘for-each@section’. 1. Set the mouse cursor at the end of the first page. and click ‘Insert’ button. Insert the following tags. Click Chart under Insert menu of Template Builder 2. For example. That’s what we are talking about! . such as check or summary. 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?> Any content above or below these two tags will appear only on the last page of the report. Computer Service and Rentals. But it’s not easy to understand this BI Beans Graph XML. Select ‘Trans Amount Remaining’ from the tree and choose ‘SUM’ from the calculation LOV.

Follow the following steps to modify the XSL definition. This is because inside the chart XSL definition the XPATH for TRANS_AMOUNT element is not set appropriately. the image doesn’t show the data in the Graph plot area though Customer names are displayed correctly. 1. 8. Example: . Double click on the Chart image 2. 7. After you click ‘OK’ you’ll see a dummy image inserted in your report. 6. Select ‘Bar Graph – Vertical’ as Type Select ‘Comet’ as Style Select ‘SUM’ as Measure and choose Click OK. 5. Click Web tab 3. At this point. Try preview you’ll see the bar graph will be displayed with actual values. Find the following tags <Cell> <xsl:value-of select="sum(current-group()/TRANS_AMOUNT)"/> </Cell> 4.Page 16 of 20 3. And check Grouping Drag and Drop ‘TRANS_AMOUNT from the left pane to main area or Value. 4. Change it to <Cell> <xsl:value-of select="sum(current-group()//TRANS_AMOUNT)"/> </Cell> Notice the extra ‘/’ between ‘current-group() and ‘TRANS_AMOUNT’.

you should see something like the following in the first page. we’re almost done. all the contents are presented. 8. Click OK. There are whole a lot of different types of graphs are supported as long as BI Beans supports. Change the font setting for the <?CUSTOMER_NAME?> to be ‘Heading 1’. 3. You can use MS Word’s section break for this. Make sure that the table of contents has <?CUSTOMER_NAME?> tag inserted. Ok. but you need to understand the Graph XML and Data XML definition. Move to the inserted first page and place your mouse cursor into the first page. 5. Type <?CUSTOMER_NAME?> and remove CUSTOMER_NAME text form. (Insert->Break->Section Break->Next Page) 4. Click Insert from the tool menu and select Reference-> Index and Tables 6.Page 17 of 20 You can also try different type of charts by using the Chart Creation Tool of the template builder. this is because the Table of Content function can not handle the text form. you can find more information on BI Beans web site. So. let’s master this very cool technique that would attracts a lot of people! It’s Table of Contents and Bookmark! Step 17: Add Table of Contents or Bookmark! Table of Contents This is pretty easy and very straightforward. 1. What you need to do is just to use MS Word native function. 2. . Click Table of Content tab and choose how you want to display your Table of Contents 7. But at the last thing. Insert a section break before the first page header so that you will have a blank page as the first page.

Create a new RTF template 2.Page 18 of 20 Step 17: Add Table of Contents or Bookmark! As one of new features that have been introduced with 10. Before. you still could create a crosstab. and you have the crosstab in your template! It’s nothing! In order to play with the crosstab.1. so you don’t want to have one blank page at the first page. Add the following tag before the table of contents. let’s start with a new data and new template. Yes. if you have been there you know what I’m talking about… It was a lot of pain! But now. Import Bookmark So the one last step! Now you have a table of contents displayed in the first page and sometimes that is what users want. But if you’re familiar with PDF document you might want to make it as a bookmark that is displayed at left pane and makes so easy to move around the document you generate. it will be converted to a bookmark. Only you need to do is to add BI Publisher’s tag before and after the table of contents that has been added at the previous step.2 is a Crosstab support through Template Builder. 1. but you need to develop some logic to support dynamically generating columns and cells. Remove the section break that has been used to create the first page for the table of contents because the table of contents is not going to be displayed. 2.3. you can just insert the crosstab from the Template Builder tool bar and map required element in the UI. <?convert-to-bookmark:?> . 1.

> Step 17: Crosstab One of the new features that have been introduced since R10. huh?! <The following section is added with the release of 10.Page 19 of 20 3. it was such a pain to insert such logic based on your data. try preview the document. If you have been there. you can just insert the crosstab object from the toolbar and drag and drop the data element in the new UI to generate the crosstab! Before this exercise let’s create a new template and load a new data for crosstab layout. you will see a bookmark that has links to each customer’s report. 7. you know what I’m talking about… Yes.xml Go to File->Page Setup and choose Landscape as Orientation Select Crosstab from the Template Builder tool bar.1. Add the following tag after the table of contents. (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. 8. . Create a new RTF template Load Crosstab_Sample_Data.2 is a Crosstab UI development support through the Template Builder. 5.3. 2.1. 1. But now things got much better. Pretty cool.3.2. 4. Before. 6. you could still develop the crosstab layout by manually developing some logic to generate dynamic columns and cells based on the data. 3. <?end convert-to-bookmark:?> Now.

you had to do this by yourself before. And then the row header of the second row is taking care of repeating Business Groups in vertical order with foreach-group loop logic.. you’ll get a crosstab layout report! As you notice there are many text forms inserted along with the creation of crosstab. And the last cell in the second row is talking care of sub-total. the last row is similar to the first row. But now you don’t really need to think about the logic. Basically. Lastly. Also with this tutorial and materials along with this training you should be confident enough to provide a training of RTF template development to somebody else. And inside the for-each-group logic there is a for-each-group loop logic. There are more RTF template development techniques. but the difference is to display total for each Type column. old days…. the first row is displaying column header by having for-each-group loop with ‘Type’ element. so keep play around with BI Publisher and you will find more fun and excitement! Have fun! .Page 20 of 20 Now when you try preview it. which you can find it in the second cell from the left in the second row. which is a total for the Business Group in the row. With all the steps done with this tutorial you should be able to develop many different varieties of BI Publisher reports and also should be able to demonstrate its strong capability and flexibility to satisfy many different business requirements on business report. you can create the crosstab in just a matter of 5 seconds! Conclusion Now you have finished all the steps and should have this fancy customer balance report that has implemented many techniques of BI Publisher and MS Word. So now you know what I was talking about! Yes.

Sign up to vote on this title
UsefulNot useful