0

I have the following data model:

<SALE_LIST>
    <SALE>
        <YEAR>2010</YEAR>
        <ITEM>100001</ITEM>
        <AMOUNT>1,199.00</AMOUNT>
    </SALE>
    <SALE>
        <YEAR>2010</YEAR>
        <ITEM>100002</ITEM>
        <AMOUNT>1,200.00</AMOUNT>
    </SALE>
    <SALE>
        <YEAR>2012</YEAR>
        <ITEM>100001</ITEM>
        <AMOUNT>1,899.00</AMOUNT>
    </SALE>
    <SALE>
        <YEAR>2012</YEAR>
        <ITEM>100003</ITEM>
        <AMOUNT>1,649.00</AMOUNT>
    </SALE>
    <SALE>
        <YEAR>2013</YEAR>
        <ITEM>100004</ITEM>
        <AMOUNT>2,199.00</AMOUNT>
    </SALE>
    <SALE>
        <YEAR>2013</YEAR>
        <ITEM>100005</ITEM>
        <AMOUNT>3,199.00</AMOUNT>
    </SALE>
</SALE_LIST>

In rtf template, using for-each to display all YEAR:

<?for-each:SALE?>
<?YEAR?>
<?end for-each?>

Normally, the result will be displayed vertically, like this:

2010
2010
2012
2012
2013
2013

How to display the result horizontally, like this: 2010 2010 2012 2012 2013 2013

Hoang Nguyen
  • 61
  • 1
  • 13

1 Answers1

3
<?for-each@inlines:SALE?>
<?YEAR?>
<?end for-each?>

If you want to print the values in horizontal table columns, you will need dynamic columns. You will have to use:

<?split–column–header:name?>
<?split–column–data:name?>

If you have installed BIP Word addon on your windows system, you will have the sample templates provided by Oracle. Go down to you BI Publisher Desktop folder, and check the samples folder. On my system, the location is:

C:\Program Files (x86)\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\samples\RTF templates\Advanced\Dynamic Columns

There will be a Dynamic Data Columns.doc file there, which explains neatly how to do this.

Ranjith R
  • 1,571
  • 1
  • 11
  • 11
  • you're cool. So how could I put the result to table, each cell is a year. – Hoang Nguyen Jul 29 '16 at 02:23
  • Thank you for your information, it's too much useful. – Hoang Nguyen Jul 29 '16 at 07:16
  • Hi, I have a requirement where the Split header should have a header and its plain text. Not related to any element. When I just add a header to the existing column, the static header is applied to only first data column, I want it to be common across all the columns. _ _ _ _ _ _ | |common | | |_ _ _ _ _ | | _|_|_|_|_|_ | – Tushar Banne Jan 11 '17 at 13:21
  • @TusharBanne, you can hardcode the plain text in the header. After , just give 'HARDCODE'?> ,where name is the node by which want to split, – Ranjith R Jan 11 '17 at 18:11