Java – JasperReports exported to Excel ignoring background color

export-to-exceljasper-reportsjava

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.

I've got a Jasper report where the rows alternating background color using the procedure referenced HERE. When I preview it using the viewer or export to PDF it works — but not when I export to Excel. I've tried using JRXlsExporter and JExcelApiExporter both to no avail.

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.

Thanks in advance!

Best Answer

Also, Be sure that the conditional styles you make, have the "opaque" option checked... If not, the background color will never apper in the excel report (never!!!)....

Also, The "opaque" option must be checked in the text fields....

And if you noticed that the text fields never took the style that you gave to them, try to set the forecolor and background to null, in the properties panel of each text field (this works for me)...

Hope this help... bye.

Related Topic