jstoneburner Posted December 29, 2009 Share Posted December 29, 2009 I'm having a problem when it comes to setting the backgroud color of my report when it is exported to Excel. Our organizatin is still using JasperReports version 3.0 for the time being.The report itself is filled correctly and displays the correct information minus any colors I added. I've tried to use both the backcolor property of the report elements for the individual fields as well as adding a colored rectangle. behind the fields. This approach works fine if I export the report to PDF format. I am using the colors #C0C0C0 and #969696 which I found as being Excel "safe."The code I'm using to generate the Excel file itself is as follows:JRXlsExporter exporterXLS = new JRXlsExporter(); exporterXLS.setParameter(JRXlsExporterParameter.JASPER_PRINT, jasperPrint);exporterXLS.setParameter(JRXlsExporterParameter.OUTPUT_FILE_NAME, filePath);exporterXLS.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, true);exporterXLS.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS, true);exporterXLS.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, true);exporterXLS.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, false); exporterXLS.exportReport(); As I said, the report is filled correctly, but is just missing the colors. Is there any advice on how to solve this? Link to comment Share on other sites More sharing options...
lucianc Posted December 30, 2009 Share Posted December 30, 2009 Excel and other grid-based exporters do not export overlapping elements, so use frames instead of rectangles.Regarding Excel colors, you can look into JExcelApiExporter which supports custom color palettes.Regards,Lucian Link to comment Share on other sites More sharing options...
jstoneburner Posted December 30, 2009 Author Share Posted December 30, 2009 Thanks for the help! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now