Issue:
The following property is available to store text content of Excel sheet headers and/or footers:
net.sf.jasperreports.export.xls.sheet.header.*
net.sf.jasperreports.export.xls.sheet.footer.*
where * can be either center, left, right.
They will appear on the Excel pages upon print preview as plain text.
How do we customize the font and size of the text that is stored when using these properties.
Solution:
There is a nice trick to include the custom font and size in the xml attribute as follows (footer example) :
<property name="net.sf.jasperreports.export.xls.sheet.footer.center"> <![CDATA[&"Simsun,bold"&16Page &P of &N]]> </property>
This can be added directly in the Source tab of the JRXML template or indirectly added as a property of the report
(Right click on the report name in the outline pane -> Advanced tab -> Edit Properties)
The above example will look like this when print previewing in Excel :
Tip: If the header or footer is not showing in the Print Preview, check your page margins.
Related Articles:
Recommended Comments
There are no comments to display.