Thursday, 6 June 2019

Add Dynamic Columns in RTF Based BI Publisher Report


Objective is to get Layout as below dynamically, where first row columns are dynamic.

Basic Salary
Exchange Commission
Food Allowance
Current
Prev.
Diff.
Current
Prev.
Diff.
Current
Prev.
Diff.
12,345.00
12,344.00
1.00
12,345.00
12,344.00
1.00
12,345.00
12,344.00
1.00


<G_EARNINGS>
<PERSON_ID>100000003353654</PERSON_ID>
<PAYROLL_ACTION_ID>43029</PAYROLL_ACTION_ID>
<BASE_ELEMENT_NAME>Basic Salary</BASE_ELEMENT_NAME>
<CURRENT></CURRENT>
<PREVIOUS></PREVIOUS>
<DIFFERENCE></DIFFERENCE>
</G_EARNINGS>

<?for-each-group@column://G_EARNINGS;./BASE_ELEMENT_NAME?><?sort:current-group()/BASE_ELEMENT_NAME;'ascending';data-type='text'?><?BASE_ELEMENT_NAME?> <?end for-each-group?>
<?for-each-group@column://G_EARNINGS;./BASE_ELEMENT_NAME?>Current
Prev.
Diff. <?end for-each-group?>
<?PREVIOUS?>
<?DIFFERENCE?><?end for-each-group?>

Row#1 : It will create dynamic columns for each value of BASE_ELEMENT_NAME, which is grouped by base_element_name, hence it will place distinct values of same.

Row#2: It will also repeat but will add 3 columns for each iteration of for-each-group.

Row#3: same as row2 but instead of static data, it will add values.

Basic Salary
Exchange Commission
Food Allowance
Current
Prev.
Diff.
Current
Prev.
Diff.
Current
Prev.
Diff.
12,345.00
12,344.00
1.00
12,345.00
12,344.00
1.00
12,345.00
12,344.00
1.00


6 comments:

  1. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  2. same thing can we do in excel template

    ReplyDelete
  3. HELLO,
    I am trying to draw dynamic report column in rtf template in a cloud instance and is not working in the same way it works in ebs
    Any idea?

    ReplyDelete
  4. I did the example but, tableshows a first column in blank. How can i do to delete this forst column?

    ReplyDelete
  5. Hi Team,

    Can we dynamically merge columns in RTF?

    Basically I want to generate only 2 rows where I will be hard coding values and rest table should follow my group by structure.

    Any pointers will be highly appreciated.

    Bipin

    ReplyDelete