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)
achieve color row banding in crosstab and table
Arif shah
<p>Hi,</p>
<p> </p>
<p>Is there any property that allows me to define row banding for a table and crosstab or do we have to do it using script? If it requires scripting, can someone please help me how to achieve this using a script</p>
<p> </p>
<p>Arif</p>
Find more posts tagged with
Comments
mwilliams
For a table, you can use a highlight rule. You set this in the property editor highlight section. What you do is select the detail row of your table, go to the highlight section of the property editor, hit add, in your condition put row.__rownum%2 equal to 1, then set the background color to your alternating highlight color.<br><br>For a crosstab, it's a little more complicated, but not much. It will require script. Take a look at this example. <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/files/file/641-crosstab-highlight-using-script/'>http://developer.actuate.com/community/forum/index.php?/files/file/641-crosstab-highlight-using-script/</a><br><br>Hope
this helps.
Arif shah
<p>Hi mwilliams,</p>
<p> </p>
<p>The example you provided helped me a lot. Now I have a bit more complex requirement. If the user does not want a row band after alternate rows but he wants to change the color if the category changes...For example have a look at the attached image</p>
<p> </p>
<p>If I do not want a color change for each row, but I want to change the color band if the category changes...in this case year is the category. and I want alternate colors for each year rows...red for 2011 all rows, blue for 2012 all rows, red for 2013 all rows again blue for 2014 and so on</p>
<p> </p>
<p>Arif</p>
mwilliams
I'm not sure exactly the method that Jason used in this example, but if you were to change a variable in the year cell when the value changes, then, all of your measure cells would probably be able to have the same script. If you want me to modify an example to do it, let me know your BIRT version and I'll create a quick example.
Arif shah
<p>Hi mwilliams,</p>
<p> </p>
<p>Many thanks. yes that will definitely help. My Birt version is 4.3.1</p>
<p> </p>
<p>I really appreciate the help</p>
<p> </p>
<p>Regards</p>
<p>Arif</p>
mwilliams
Check out this design. Specifically, the script in the onCreate of the crosstab.