Jasper HTML输出宽度问题 [英] Jasper HTML output width issue

查看:573
本文介绍了Jasper HTML输出宽度问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此报告是使用带有REST API的jasper报告工具生成的。报告数据显示在带有iframe的HTML页面中。将数据加载到iframe后,报告HTML视图,在左侧和右侧显示大量空白区域。我试过增加CSS中的iframe宽度。但这不会影响报告。是否可以从碧玉报告本身调整白色空间?我使用的页面大小为A4横向。

This report is generated with jasper reporting tool with REST API. Report data is showing in an HTML page with an iframe. After loading data to the iframe, report HTML view showing a lot of white spaces in the right and left side. I have tried with increasing the iframe width in CSS. But this is not affecting the report. Is it possible to adjust white spaces from jasper report itself? I am using page size as A4 landscape.

我附上了图片:


我附上了再次出现图像,您可以看到左侧和右侧的空白区域。如何删除?我也附上了jrxml链接。请帮助。

Hi, I have attached the image once again, You can see the Blank spaces on left and right side. How to remove this?. i have attached the jrxml link also. please help.


https://files.fm/u/56nnrd9z
您好,
我再次附上了Jrxml代码链接,请检查一下。
https://drive.google.com/file/ d / 1P9aeNW7YTIndNDyv8jkCwO_RQGf32iZu / view?usp = sharing

推荐答案

各种设置会影响HTML报告的输出宽度,包括:

Various settings affect the output width of HTML reports, including:

  • Size unit (POINT vs PIXEL)
  • Zoom ratio
  • Page margins

例如:

final SimpleHtmlReportConfiguration configuration = new SimpleHtmlReportConfiguration();

configuration.setIgnorePageMargins(true);
configuration.setSizeUnit(POINT);

// Or try this instead of setSizeUnit(POINT)...
//configuration.setZoomRatio(2.0f);

final HtmlExporter exporter = new HtmlExporter();
exporter.setConfiguration(configuration);

如果报告中有图像,请考虑使用SVG格式以避免像素化。
有关这些设置的其他信息,请访问:

If there are images in the report, consider using SVG format to avoid pixelation. Additional information about these settings is at:

  • https://community.jaspersoft.com/jasperreports-library/issues/4483
  • https://community.jaspersoft.com/jasperreports-server/issues/6577

从JasperSoft社区网站,您可以在JRXML文件中设置缩放比例,如下所示:

From the JasperSoft community site, you can set the zoom ratio in a JRXML file, described as follows:


您应该可以通过在报告级别设置此属性来设置默认缩放值:

You should be able to set a default zoom value by setting this property at report level:

< property name =net.sf.jasperreports.viewer.zoomvalue =FitWidth/>

其他可能值:


  • ActualSize

  • FitHeight

  • FitPage

  • 整数(例如,2表示200%)

  • 小数(例如,0.5为50%)

  • ActualSize
  • FitHeight
  • FitPage
  • integers (e.g., 2 for 200%)
  • decimals (e.g., 0.5 for 50%)

这篇关于Jasper HTML输出宽度问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆