Oracle BI publisher for each group alternate colors rtf

1.1k Views Asked by At

I have a table inside a for-each group and I would want the table to have alternate colors. I am using the below snippet in the rtf template

<?for-each-group:ROW;./INVOICE_NUMBER?> 
   <?if:xdoxslt:get_variable($_XDOCTX,'counter') mod 2=1?> <?attribute@incontext:background-color;'lightgray'?> <?end if?>

    Invoice number: INVOICE_NUMBER      Invoice  Amount: AMOUNT     


<?xdoxslt:set_variable($_XDOCTX,'counter',xdoxslt:get_variable($_XDOCTX,'counter') + 1)?>
<?end for-each-group?>

The statement <?attribute@incontext:background-color;'lightgray'?> throws an exception java.lang.ClassCastException: oracle.xdo.template.fo.elements.FOStaticContent cannot be cast to oracle.xdo.template.fo.elements.FOBlockLevel

How do I give a background colors to alternate groups inside the for each ?

Thanks

2

There are 2 best solutions below

0
On BEST ANSWER

I assume this is not working - see

https://docs.oracle.com/middleware/11119/bip/BIPRD/supp_xsl_fo.htm

there is no support for background-color for blocks as far as I can see

0
On

Background colors are not supported. If you are using RTF templates, you could create a table in word with alternate row colors and it should work. (I haven't tried this)