Jasper 报告的边距大于设定值
我有一个 jasper 报表设置为纵向字母,以像素计算,在 iReport 中转换为 612 x 792。我将左边距设置为 17 像素,右边距设置为 10。这使得单列宽度为 585,没有间距。
现在,我有两条垂直线用于形成报表的边框,它们位于 x 坐标 0(左栏)和 585(右栏)处。执行此报告后,生成的 PDF 看起来非常完美。但是,当我进行打印时,两条垂直线丢失了,我必须选择缩小以适应(将缩放设置为 94% 并显示所有内容)。
我做了一些实验,并且,在打印时不缩小报告的情况下,垂直线需要定位在 x 坐标 2(左侧)和 575(右侧)才能显示,这本质上转化为x 边距为 19 像素。再试一下,如果我将左边距设置为 19,则打印时位于 x 坐标 0 处的左侧垂直条会显示。
除了 jasper 报告本身之外,还有其他设置将边距设置为 19 像素吗?我在报告本身中找不到任何似乎造成这种差异的罪魁祸首。非常感谢任何帮助。
I have a jasper report set to portrait letter, which, in pixel terms, translates to 612 x 792 in iReport. I have the left margin set to 17 pixels and the right set to 10. That leaves the single column width at 585 with no spacing.
Now, I have two vertical lines that are used to form the report's border, and they're positioned at x-coordinates 0 (for the left bar) and 585 (for the right). When this reported is executed, the resultant PDF looks perfectly fine. However, when I go to print, the two vertical lines are missing, and I have to select shrink to fit (which sets the zoom to 94% and displays everything).
I've done some experimenting, and, without shrinking the report at print time, the vertical lines need to be positioned at x-coordinates 2 (for the left) and 575 (for the right) in order to display, which translates into essentially an x-margin of 19 pixels. Playing around some more, if I set the left margin to 19, the left vertical bar displays at print time when positioned at x-coordinate 0.
Is something else setting the margins at 19 pixels aside from the jasper report itself? I can't find any culprits in the report itself that seem to be responsible for the discrepancy. Any help is greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
大多数打印机无法打印到页面边缘。听起来你已经达到了这个极限。打印驱动程序检测到 PDF 不适合打印机的可打印区域,并允许您缩小内容以适合打印机支持的内容。
Most printers can't print up to the edge of a page. It sounds like you are hitting this limit. The print driver is detecting that the PDF doesn't fit inside the printer's printable area and allows you to shrink the content to fit what the printer supports.
这只是一个猜测。在我的报告中,我使用 iReport 中的背景带并绘制一个矩形作为报告的背景。
This is just a guess. In my reports I use the Background-Band in iReport and draw a rectangle for the background of my reports.