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)
Color Change in table row
CaTcHmE
<span style='font-family: Arial'><br />
Hi to All,<br />
<br />
Please help me to resolve the problem,<br />
I have a table in a report where i need to set alternate color for the table row. I have done it, but in the JOBTITLE column if the value is consecutively repeating means i need to set color as next alternate color. i.e gray. For example the row constains emp no 1286,1323,1370 should be in gray color.<br />
Same as in the second highlighted rectangle box should be in silver color.<br />
<br />
I have also enclosed the image and rptdesign.<br />
<br />
Kindly help me to fix the problem.<br />
<br />
<br />
Thanks in Advance.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
</span>
Find more posts tagged with
Comments
mcremer
<blockquote class='ipsBlockquote' data-author="'CaTcHmE'" data-cid="82236" data-time="1314937472" data-date="01 September 2011 - 09:24 PM"><p>
Hi to All,<br />
<br />
Please help me to resolve the problem,<br />
I have a table in a report where i need to set alternate color for the table row. I have done it, but in the JOBTITLE column if the value is consecutively repeating means i need to set color as next alternate color. i.e gray. For example the row constains emp no 1286,1323,1370 should be in gray color.<br />
Same as in the second highlighted rectangle box should be in silver color.<br />
<br />
I have also enclosed the image and rptdesign.<br />
<br />
Kindly help me to fix the problem.<br />
<br />
<br />
Thanks in Advance.<br /></p></blockquote>
<br />
Hey CaTcHmE,<br />
<br />
I had a simular problem (puting altarate row coloring on groups becouse we didnt have detail rows to show. I think the java script I wrote for that could help you.<br />
<br />
I written on the onCreate event of the group row (in Your case it would be detail row) the folowing SCRIPT:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
if (reportContext.getGlobalVariable("alt_grp") == false)
reportContext.setGlobalVariable("alt_grp", true);
else
reportContext.setGlobalVariable("alt_grp", false);
</pre>
<br />
Then in the Properties of that row I went to the Higlichts tab and made a Condition on the ont he folowing:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>reportContext.getGlobalVariable("alt_grp") = Thrue</pre> to set the collor to gray.<br />
<br />
Now I can reimagine that to somting like this you still keep the above script but extend it somwat with somting like this:<br />
<br />
On the Data object were you want to keep an eye on the duble feature you set the following script on the onCreate event:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var rowLast = BirtStr.trim(''+reportContext.getGlobalVariable("PRODUCT_rlp"));
var rowLastp = this.getRowData().getColumnValue("PRODUCT");
reportContext.setGlobalVariable("rowLast", rowLast);
reportContext.setGlobalVariable("rowLastp", rowLastp);
</pre>
<br />
Now the Conditional for the higlicht changes a bit to some Thing like:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var switch = reportContext.getGlobalVariable("lastCollorHiglicht");
var switch1 = false;
var switch2 = false;
var switch3 = false;
if( reportContext.getGlobalVariable("alt_grp") ){
var switch1 = true;
}else{
var switch1 = false;
}
if( row["detailRow"] == reportContext.getGlobalVariable("rowLastp") ){
var switch2 = true;
}else{
var switch2 = false;
}
if( switch1 && switch2 ){
var switch3 = true;
}else{
var switch3 = false;
}
</pre>
<br />
This is a roug code example of course but I hope it nudges you to the richt way.