有没有一种方法可以通过在从Java调用Jasper时设置参数来将Author属性设置为PDF文档。Jasper Report - 在PDF文档中设置Author属性
我这是怎么生成从Java碧玉报告。
JasperPrint jasperPrint;
String outFile = "39285923953222.pdf";
HashMap hm = new HashMap();
hm.put("ID",id);
hm.put("FOOTER",Constants.FOOTER); // Set somehow a string for the author name
Session session = this.sessionFactory.openSession();
Connection con = session.connection();
jasperPrint = JasperFillManager.fillReport(jasperPath + "myReport.jasper", hm, con);
JasperExportManager.exportReportToPdfFile(jasperPrint, outPath + outFile);
谢谢@lschin,这就是我一直在寻找的。今天会试用。 – Adnan 2011-04-06 06:07:32
请注意,这在较新版本中已被弃用,请参阅:http://stackoverflow.com/questions/24117878/jasperreports-5-6-jrxlsexporter-setparameter-is-deprecated – 2015-06-12 08:43:26