Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Display cell color dynamically in the dynamic table
SudhakarA
Hi, <br />
The attached code works great in the Birt Design view as well as using Scripted DataSet.<br />
<br />
And now the actual requirement is to change the cell color based on the condition dynamically.<br />
some of the cells in the rows should display in Grey or Green or Yellow based on the condition.<br />
<br />
I tried to fix this requirement in the below code .....<br />
<br />
//Detail<br />
columnNameArray = params["columnNameList"].value.split(",");<br />
computedSet = table.getColumnBindings( );<br />
detail = table.getDetail( ).get( 0 );<br />
<br />
for (i = 0; i < columnNameArray.length; i++) {<br />
cs1 = StructureFactory.createComputedColumn( );<br />
cs1.setName("\"" + columnNameArray
+ "\"");<br />
cs1.setExpression( "dataSetRow[\"" + columnNameArray
+ "\"]");<br />
computedSet.addItem( cs1 );<br />
<br />
tcell = detail.getCells( ).get( i );<br />
data = elementFactory.newDataItem( null );<br />
data.setResultSetColumn("\"" + columnNameArray
+ "\"");<br />
tcell.getContent( ).add( data );<br />
}<br />
<br />
But I failed to do because I can't able to capture the display value from the cell so that I can change the style like "tcell.setStyleName("styleGrey") and etc...".<br />
<br />
Can I get come help on this to display dynamic color based on the condition?<br />
<br />
<br />
Thanks,<br />
Sudhakar
Find more posts tagged with
Comments
SudhakarA
<blockquote class='ipsBlockquote' data-author="'SudhakarA'" data-cid="91435" data-time="1323686636" data-date="12 December 2011 - 03:43 AM"><p>
Hi, <br />
The attached code works great in the Birt Design view as well as using Scripted DataSet.<br />
<br />
And now the actual requirement is to change the cell color based on the condition dynamically.<br />
some of the cells in the rows should display in Grey or Green or Yellow based on the condition.<br />
<br />
I tried to fix this requirement in the below code .....<br />
<br />
//Detail<br />
columnNameArray = params["columnNameList"].value.split(",");<br />
computedSet = table.getColumnBindings( );<br />
detail = table.getDetail( ).get( 0 );<br />
<br />
for (i = 0; i < columnNameArray.length; i++) {<br />
cs1 = StructureFactory.createComputedColumn( );<br />
cs1.setName("\"" + columnNameArray
+ "\"");<br />
cs1.setExpression( "dataSetRow[\"" + columnNameArray
+ "\"]");<br />
computedSet.addItem( cs1 );<br />
<br />
tcell = detail.getCells( ).get( i );<br />
data = elementFactory.newDataItem( null );<br />
data.setResultSetColumn("\"" + columnNameArray
+ "\"");<br />
tcell.getContent( ).add( data );<br />
}<br />
<br />
But I failed to do because I can't able to capture the display value from the cell so that I can change the style like "tcell.setStyleName("styleGrey") and etc...".<br />
<br />
Can I get come help on this to display dynamic color based on the condition?<br />
<br />
<br />
Thanks,<br />
Sudhakar<br /></p></blockquote>
<br />
And also the output of the report should work in HTML,PDF and in Excel.
SudhakarA
<blockquote class='ipsBlockquote' data-author="'SudhakarA'" data-cid="91435" data-time="1323686636" data-date="12 December 2011 - 03:43 AM"><p>
Hi, <br />
The attached code works great in the Birt Design view as well as using Scripted DataSet.<br />
<br />
And now the actual requirement is to change the cell color based on the condition dynamically.<br />
some of the cells in the rows should display in Grey or Green or Yellow based on the condition.<br />
<br />
I tried to fix this requirement in the below code .....<br />
<br />
//Detail<br />
columnNameArray = params["columnNameList"].value.split(",");<br />
computedSet = table.getColumnBindings( );<br />
detail = table.getDetail( ).get( 0 );<br />
<br />
for (i = 0; i < columnNameArray.length; i++) {<br />
cs1 = StructureFactory.createComputedColumn( );<br />
cs1.setName("\"" + columnNameArray
+ "\"");<br />
cs1.setExpression( "dataSetRow[\"" + columnNameArray
+ "\"]");<br />
computedSet.addItem( cs1 );<br />
<br />
tcell = detail.getCells( ).get( i );<br />
data = elementFactory.newDataItem( null );<br />
data.setResultSetColumn("\"" + columnNameArray
+ "\"");<br />
tcell.getContent( ).add( data );<br />
}<br />
<br />
But I failed to do because I can't able to capture the display value from the cell so that I can change the style like "tcell.setStyleName("styleGrey") and etc...".<br />
<br />
Can I get come help on this to display dynamic color based on the condition?<br />
<br />
<br />
Thanks,<br />
Sudhakar<br /></p></blockquote>
<br />
And also the output of the report should work in HTML,PDF and in Excel.
SudhakarA
Hi,
Can I get your feedback and suggestion to implement the above addressed requirement?
Thanks,
Sudhakar
SudhakarA
Hi,
Can I get any reply on this?
Thanks,
Sudhakar
SudhakarA
Hi Team,
Can I get any response for this post?
Thanks,
Sudhakar