Symptom
When exporting a report to XLS output using a web services call in JasperReports Server v4.2, the user sees the report cell background color not matching the color as designed. Other report format outputs do not have this issue.
Report created in JasperReports Server web UI in HTML output:
Report exported through JasperReports Server web UI in PDF format:
Report exported through JasperReports Server web UI in XLS format:
Report exported using JasperReports Server Web Services requests in PDF format:
Report exported using JasperReports Server Web Services requests in XLS format where the cell background color discrepancy is evidenced:
Cause
JasperReports Server configures JExcelApiExporter to use custom palette to populate report output with the exact report colors. This affects all report unit executions in server users sessions. However, web services requests and scheduler job executions do not use custom palette for color mapping by default, thus users will observe the color discrepancies because of color approximation based on default XLS 256 colors palette.
Solution
Users can enforce the custom palette being used by XLS exporter for all report executions regardless its initiation origins. To do this, edit WEB-INFclassesjasperreports.properties file and add the following property setting:
net.sf.jasperreports.export.xls.create.custom.palette=true
Save the change and restart server to make this setting take effect.
TTC-20130809
Recommended Comments
There are no comments to display.
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