0
我正在使用Java程序中使用iReport生成的* .jasper報表。我需要以編程方式更改報告方向。這是我的代碼:在Java中更改Jasper報表的頁面方向
final File template = new File("report.jasper");
final JasperReport jasperReport = (JasperReport) JRLoader.loadObject(template);
//connection is defined previously
final JasperPrint print = JasperFillManager.fillReport(jasperReport, metadata, connection);
//reprot.jasper is defined with LANDSCAPE orientation
print.setOrientation(OrientationEnum.PORTRAIT);
最後一行對生成的pdf或屏幕組件都沒有影響。
任何想法?