有没有办法在Java的Jasper Reports中设置docx,xlsx和odt的文档属性(如作者,标题和注释)?我有一个3.7.0版本的Jasper Reports。
答案 0 :(得分:2)
此代码可能对您有用
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();