title: Oracle BI publisher for each group alternate colors rtf
body: <p>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</p>
  <pre><code>&lt;?for-each-group:ROW;./INVOICE_NUMBER?&gt; 
     &lt;?if:xdoxslt:get_variable($_XDOCTX,'counter') mod 2=1?&gt; &lt;?attribute@incontext:background-color;'lightgray'?&gt; &lt;?end if?&gt;
  
      Invoice number: INVOICE_NUMBER      Invoice  Amount: AMOUNT     
  
  
  &lt;?xdoxslt:set_variable($_XDOCTX,'counter',xdoxslt:get_variable($_XDOCTX,'counter') + 1)?&gt;
  &lt;?end for-each-group?&gt;
  </code></pre>
  <p>The statement <code>&lt;?attribute@incontext:background-color;'lightgray'?&gt;</code>  throws an exception java.lang.ClassCastException: oracle.xdo.template.fo.elements.FOStaticContent cannot be cast to oracle.xdo.template.fo.elements.FOBlockLevel</p>
  <p>How do I give a background colors to alternate groups inside the for each ?</p>
  <p>Thanks</p>