I'm using JRXlsxExporter to export my JasperReport to XLSX format. To create the output stream, I'm opening up a blob stream and setting it to the SimpleOutputStreamExporterOutput. The blob is then saved to the DB after the exporter.exportReport() method is called.
OutputStreamExporterOutput simpleOutputStreamExporterOutput = new SimpleOutputStreamExporterOutput(blob.setBinaryStream(1));
The problem is, there is a jpg image part of the report content. When the report is exported to XLSX, 'The image cannot be displayed' message shows up in the xlsx in place of the image, but the rest of the data comes up fine.
I tried using a FileOutputStream instead of the blob stream and everything including the image comes up fine in the exported xlsx. But since I cannot be saving the exported report files on the application servers, and since I have to write to the DB as a blob, I would most definitely want to use the blob stream.
- Jasper reports version - 6.2.0
- Dynamic Jasper version - 5.0.4
I'm using the DynamicReportBuilder addFirstPageImageBanner() method to add the image. Here's the code to add the image:
drb.addFirstPageImageBanner("imagepath" + "imagename", new Integer(197), new Integer(53), ImageBanner.ALIGN_LEFT);
Here's part of my jrxml file as well. But I'm not using the image tag in the jrxml to add the image though, it is being done with the above method.
Is this a known bug with the 6.x release, with the Blob output stream? Coz it used to work for us fine with the 3.x release.
Any help is deeply appreciated. Thank you!