如何在Java中设置Jasper报告的边距!
我有带有边距的reports.jasper,但是打印时我必须更改边距!
JasperPrint.setTopMargins(myMarginsValue)
不起作用!!!
我使用 JRPrintServiceExporter
发送到打印机!
当前代码:
InputStream reportStream = FacesContext.getCurrentInstance().getExternalContext().getResourceAsStream("/reports/" + "myReport"+".jasper");
JasperReport template = (JasperReport) JRLoader.loadObject(reportStream);
template.setWhenNoDataType(WhenNoDataTypeEnum.ALL_SECTIONS_NO_DETAIL);
PrintRequestAttributeSet printRequestAttributeSet = new HashPrintRequestAttributeSet(); printRequestAttributeSet.add(MediaSizeName.ISO_A4); - Landre