我有一个jasper报告模板,页面大小是A4,现在想打印在B5纸上。我该怎么做才能使内容不从纸上打印出来。
问问题
5302 次
2 回答
1
您需要设置pageWidth="501"
和pageHeight="709"
标记jasperReport
ISO 216,如您所见,B5 为 176 × 250 in mm
在碧玉报告大小以像素表示(DPI 72)
pixels = (mm * dpi) / 25.4; //The DPI in jasper report is 72
计算将给出宽度 499,jasper 报告使用默认值 501,考虑到格式具有 1.5 毫米的公差,任何一个值都可以。
边距为 20 的示例
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="testSize" pageWidth="501" pageHeight="709" columnWidth="461" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="e1be95c1-b1c3-499e-b902-99cda67676af">
于 2016-01-25T09:01:12.440 回答