Skip to Content
0
May 25, 2016 at 02:34 PM

XSLT transformation - change the cell style dynamically

839 Views

Hi,

I am using XSLT transformation technique for downloading data into formatted excel. I have created the transformation. we have amount field as one of the column in excel. The challenge here is amount format changes depending on currency. for example fro JPY there are no decimal places for EUR decimlas paces are 2. So in a column different cells need to have different format.

in XSLT I have below code for this cell

<Cell ss:StyleID="s63">

<Data ss:Type="Number">

<tt:value ref="TOTAL_VALUE"/>

</Data>

</Cell>

style s63 is

<Style ss:ID="s63">

<Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/>

<NumberFormat ss:Format="#,##0"/>

</Style>

This code works for JPY but not for EUR.

the cell statement executes in a loop over data which comes from ABAP WD program and lets assume that I have a field which says about the number of decimal places that needs to be displayed. Also assume that I have create <Style> coding for different decimal formats ( like one for 0 decimals and one for 2 decimals etc.,). Assuming that I have this information with me in XSLT run time, how can I change the transformation code,so that amounts are displayed correctly?