Jasper report exported to excel format is not disp

2019-09-03 11:41发布

问题:

I am using jasper reports-4.5.0 . Using this I am generating the reports properly and exporting to different formats like pdf,csv,xls,html. All are working fine except the .xls format. When I export my report to .xls it is not displaying the background colour to the pageheader band. The code I am using is as below. Inside the page header band

<image>
    <reportElement mode="Opaque" x="0" y="0" width="236" height="57" backcolor="#E6E6E6"/>
    <imageExpression><![CDATA[new File($P{Image}, "images/flower-logo.png")]]></imageExpression>
</image>

To the flower image I am applying the background colour. It is coming in all the other formats except the .xls format. What could be the problem with excel format.

回答1:

JasperReports XLS exporters only support the standard Excel color palette. I think you can see the color list here. http://dmcritchie.mvps.org/excel/colors.htm