How to attach an image to the Excel printed header/footer


We are using JasperReports library (version 4.5.1) to export our reports as Excel 2007 (XLSX format) files.

A new requirement came in: add an image (logo) to the header or footer section of the Excel sheet (In Excel application one could do that by opening the print preview, then opening the Page Setup dialog, Header/Footer tab and then choosing Custom Header or Footer.)

My question is two-fold:

1. Where to add the image in the *.jrxml file so that the image (in the generated Excel) will only be visible when the user opens the print preview (or prints) from Excel?

2. If it is not possible to insert the image in the Jasper report at design time, is there an API available to do some sort of post-processing and modify the JasperPrint object (via the JRXlsxExporter or perhaps JRExcelApiExporter) and insert the image as a custom header/footer of the sheet?


valeriu.nedelcu's picture
Joined: Apr 8 2013 - 3:59am
Last seen: 8 years 2 days ago

0 Answers:

No answers yet