You are here: BI Publisher In a RTF Template how to display measures as rows in a table

In a RTF Template how to display measures as rows in a table

Written by  Anil
Rate this item
(1 Vote)

As we display the measures as columns in a table, we can also modify this display structure in output to display these measure columns as rows.


Consider below XML

<GROUP_PERCENTAGE>

    <PERCENTAGE>

                <DEPARTMENT>CSE</DEPARTMENT>

                <CRETERIA>PASSPERCENTAGE</CRETERIA>

                <MALE>70</MALE>

                <FEMALE>30</FEMALE>

   </PERCENTAGE>

      <PERCENTAGE>

                <DEPARTMENT>IT</DEPARTMENT>

                <CRETERIA>PASSPERCENTAGE</CRETERIA>

                <MALE>65</MALE>

                <FEMALE>35</FEMALE>

   </PERCENTAGE>

        <PERCENTAGE>

                <DEPARTMENT>ECE</DEPARTMENT>

                <CRETERIA>PASSPERCENTAGE</CRETERIA>

                <MALE>55</MALE>

                <FEMALE>45</FEMALE>

   </PERCENTAGE>

     <PERCENTAGE>

                <DEPARTMENT>EEE</DEPARTMENT>

                <CRETERIA>PASSPERCENTAGE</CRETERIA>

                <MALE>75</MALE>

                <FEMALE>25</FEMALE>

   </PERCENTAGE>

   <PERCENTAGE>

                <DEPARTMENT>CSE</DEPARTMENT>

                <CRETERIA>FAILPERCENTAGE</CRETERIA>

                <MALE>30</MALE>

                <FEMALE>70</FEMALE>

   </PERCENTAGE>

 <PERCENTAGE>

                <DEPARTMENT>IT</DEPARTMENT>

                <CRETERIA>FAILPERCENTAGE</CRETERIA>

                <MALE>35</MALE>

                <FEMALE>65</FEMALE>

   </PERCENTAGE>

<PERCENTAGE>

                <DEPARTMENT>ECE</DEPARTMENT>

                <CRETERIA>FAILPERCENTAGE</CRETERIA>

                <MALE>45</MALE>

                <FEMALE>55</FEMALE>

   </PERCENTAGE>

<PERCENTAGE>

               <DEPARTMENT>EEE</DEPARTMENT>

               <CRETERIA>FAILPERCENTAGE</CRETERIA>

               <MALE>25</MALE>

               <FEMALE>75</FEMALE>

  </PERCENTAGE>

</GROUP_PERCENTAGE>

In general, when we build an RTF template for the above xml and the output is as below 

 

In order to display measures as rows in a table structure for easy analysis we should change the fields of table structure as below:

 

The above one is the table structure to display the measures as rows in a table.Now you can observe the below output

 

Below are the form fields where we modified them for displaying in the above way

 

For :                <?for-each-group@column:PERCENTAGE;CRETERIA?>

To group the data by CRETERIA; and the @column context command to create a table column for each group (CRETERIA).

 CRETERIA:    <?CRETERIA?>

Placeholder for the CRETERIA element.

 End:                <?end for-each-group?>

Closes the for-each-group loop.

 Department:  <?for-each-group:PERCENTAGE;./DEPARTMENT?><?variable@incontext:G1;current-group()?><?DEPARTMENT?>

Begins the group to create a table row for each DEPARTMENT.

 MALE:            <?for-each-group@cell://PERCENTAGE;./CRETERIA?><?sum ($G1[(./CRETERIA=current()/CRETERIA)]/MALE)?><?end for-each-group?>

To group the data by CRETERIA; and the @cell context command to create a table cell for each group (CRETERIA).

Sums the sales for the current group (CRETERIA).

 FEMALE:       <?for-each-group@cell://PERCENTAGE;./CRETERIA?><?sum ($G1[(./CRETERIA=current()/CRETERIA)]/FEMALE)?><?end for-each-group?>

To group the data by CRETERIA; and the @cell context command to create a table cell for each group (CRETERIA).

Sums the sales for the current group (CRETERIA).

 

"If you found this article useful, please rate the same"

If you need any assistance in BI Publisher implementation or RTF Template design, we can

help you out. please send your query to   This e-mail address is being protected from spambots. You need JavaScript enabled to view it

Read 10212 times

1 comment

  • Comment Link shoma b Friday, 19 October 2012 09:16 posted by shoma b

    i want to display the rows dynamically in RTF template. As per the requirment the table will have 3 columns which will display the data value. If there are 10 data values then each row will display 3 values in 3 columns and the next value should be displayed in a new row. kindly provide any information on the same.

    Report

Leave a comment

Make sure you enter the (*) required information where indicated.
Basic HTML code is allowed.