<p>Have you ever had alternating background colors in a Jasper report and then exported it to Excel?  The Excel export seems to ignore the alternating color.</p>

<p>I've got a Jasper report where the rows alternating background color using the procedure referenced <a href="http://www.brianburridge.com/2006/06/19/highlighting-odd-even-rows-jasperreports" rel="nofollow noreferrer">HERE</a>.  When I preview it using the viewer or export to PDF it works -- but not when I export to Excel.  I've tried using <code>JRXlsExporter</code> and <code>JExcelApiExporter</code> both to no avail. </p>

<p>I think it might be a side-effect of how you have to make alternating row colors in Jasper, which I despise to begin with, but have found no other way.</p>

<p>Thanks in advance!</p>

Did you try the idea suggested in the
comment
of the very procedure you are referring to ?
First how to create new report style with condition:
Recent releases of JasperReports include report styles, which make this a bit easier - you no longer have to create the rectangle.
I use iReport to create my styles - there is a “styles” pane that by default is docked with the “Library” pane. If you make it visible you can create a new style in the styles library. In the screen that pops up give the style a name (say “EvenOddRowStyle” and press “Add” under “Style Conditions”. Use one of the expressions that Brian gave and press Apply. and in the “Common” section press the “…” button next to “Backcolor” and pick the background color you want. Finally, when done with your report apply that style to all the fields in the rows you want to highlight. Just drag the style from the styles pane onto the field.
Then how to define a style which will be applied when exported to Excel:
defining a new style with the condition expression:
```
```
Boolean.valueOf( $V{PAGE_COUNT}.intValue() % 2 == 0 )
```
```
on it
without using a rectangle and a print when expression on it
!