Modify Row Data of the table in BIRT

sirajm
edited February 11, 2022 in Analytics #1
<p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">I want to change the data present in the row of the table which I used for grouping purpose in the BIRT. I know how to retrieve the value but I want to change the rendering value, precisely I want to transform the string. I checked an example on official page <a data-ipb='nomediaparse' href='https://www.eclipse.org/birt/phoenix/deploy/reportScripting.php'>here</a>:</p><p><span style="margin:0px;background-color:transparent;color:rgb(0,0,139);">if</span><span style="margin:0px;background-color:transparent;"> </span><span style="margin:0px;background-color:transparent;">(</span><span style="margin:0px;background-color:transparent;color:rgb(0,0,139);">this</span><span style="margin:0px;background-color:transparent;">.</span><span style="margin:0px;background-color:transparent;">getRowData</span><span style="margin:0px;background-color:transparent;">().</span><span style="margin:0px;background-color:transparent;">getExpressionValue</span><span style="margin:0px;background-color:transparent;">(</span><span style="margin:0px;background-color:transparent;color:rgb(128,0,0);">3</span><span style="margin:0px;background-color:transparent;">)</span><span style="margin:0px;background-color:transparent;"> </span><span style="margin:0px;background-color:transparent;">></span><span style="margin:0px;background-color:transparent;"> </span><span style="margin:0px;background-color:transparent;color:rgb(128,0,0);">100</span><span style="margin:0px;background-color:transparent;">)</span><br />
<span style="margin:0px;background-color:transparent;color:rgb(0,0,139);">this</span><span style="margin:0px;background-color:transparent;">.</span><span style="margin:0px;background-color:transparent;">getStyle</span><span style="margin:0px;background-color:transparent;">().</span><span style="margin:0px;background-color:transparent;">backgroundColor</span><span style="margin:0px;background-color:transparent;">=</span><span style="margin:0px;background-color:transparent;color:rgb(128,0,0);">"red"</span><span style="margin:0px;background-color:transparent;">;</span><span style="margin:0px;background-color:transparent;color:rgb(128,128,128);">//This will only change the row instance</span></p><p> </p><p>[color=rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;]This is helpful to change the style of the text but I want to change the text rather than the style[/color]</p><p><span style="margin:0px;background-color:transparent;color:rgb(0,0,139);">var</span><span style="margin:0px;background-color:transparent;"> t </span><span style="margin:0px;background-color:transparent;">=</span><span style="margin:0px;background-color:transparent;"> </span><span style="margin:0px;background-color:transparent;color:rgb(0,0,139);">this</span><span style="margin:0px;background-color:transparent;">.</span><span style="margin:0px;background-color:transparent;">getRowData</span><span style="margin:0px;background-color:transparent;">().</span><span style="margin:0px;background-color:transparent;">getExpressionValue</span><span style="margin:0px;background-color:transparent;">(</span><span style="margin:0px;background-color:transparent;color:rgb(128,0,0);">"row[colname]"</span><span style="margin:0px;background-color:transparent;">);</span><br />
<span style="margin:0px;background-color:transparent;">t</span><span style="margin:0px;background-color:transparent;">=</span><span style="margin:0px;background-color:transparent;"> t</span><span style="margin:0px;background-color:transparent;">.</span><span style="margin:0px;background-color:transparent;">toUpperCase</span><span style="margin:0px;background-color:transparent;">();</span><span style="margin:0px;background-color:transparent;"> </span><span style="margin:0px;background-color:transparent;color:rgb(128,128,128);">//any string transformation</span><br />
<span style="margin:0px;background-color:transparent;color:rgb(0,0,139);">this</span><span style="margin:0px;background-color:transparent;">.</span><span style="margin:0px;background-color:transparent;">valueExpr </span><span style="margin:0px;background-color:transparent;">=</span><span style="margin:0px;background-color:transparent;"> t</span><span style="margin:0px;background-color:transparent;">;</span><span style="margin:0px;background-color:transparent;"> </span><span style="margin:0px;background-color:transparent;color:rgb(128,128,128);">//this is not working</span></p><p> </p><p>[color=rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;]So how to assign new string to the row. I write this script at onRender event of the row. But it is not working. Any Idea?[/color]</p>

Comments