Jasper reports - set document properties (author, title ..) in docx, xlsx, odt

Is there a way to set document properties (such as author, title and comment) of docx, xlsx and odt in Jasper reports with Java? I have version 3.7.0 of Jasper reports.

+4
source share
1 answer

This code may be useful to you.

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperPath + "myReport.jasper", hm, con); JRPdfExporter exporter = new JRPdfExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_FILE, outPath + outFile); exporter.setParameter(JRPdfExporterParameter.METADATA_AUTHOR, "Adnan"); exporter.setParameter(JRPdfExporterParameter.METADATA_TITLE, "Title"); // ... exporter.exportReport(); 
+2
source

Source: https://habr.com/ru/post/1489735/


All Articles