Java 无法删除行之间的空白
我想将报告导出为html格式,并使用Java 无法删除行之间的空白,java,jasper-reports,Java,Jasper Reports,我想将报告导出为html格式,并使用SimpleHtmlReportConfiguration设置一些配置。exporter.setConfiguration(reportConfig)不工作。我不知道 我的旧代码: HtmlExporter exporter = new HtmlExporter(); // output file for generated html report File file = new File(outputFileName); // setting so
SimpleHtmlReportConfiguration
设置一些配置。exporter.setConfiguration(reportConfig)
不工作。我不知道
我的旧代码:
HtmlExporter exporter = new HtmlExporter();
// output file for generated html report
File file = new File(outputFileName);
// setting some sonfigs for the report
exporter.setExporterInput(new SimpleExporterInput(filedReport));
SimpleHtmlExporterOutput exporterOutput = new SimpleHtmlExporterOutput(file);
// the folder for storing images. It will be subfolder with name starting like generated html and ended with postfix "_files"
File resourcesDir = new File(file.getParent(), file.getName() + "_files");
// argument ({0}) will be replaced with the real image name
String imageURI = "qip?srvAction=ReportImage&img="+returnFileName.substring(3).replace("/", "%2F")+"_files"+"%2F" + "{0}";
exporterOutput.setImageHandler(new FileHtmlResourceHandler(resourcesDir, imageURI));
exporter.setExporterOutput(exporterOutput);
SimpleHtmlExporterConfiguration exporterConfig = new SimpleHtmlExporterConfiguration();
exporterConfig.setBetweenPagesHtml("");
exporter.setConfiguration(exporterConfig);
SimpleHtmlReportConfiguration reportConfig = new SimpleHtmlReportConfiguration();
reportConfig.setRemoveEmptySpaceBetweenRows(true);
exporter.setConfiguration(reportConfig);
行之间的空白可能意味着模板设计存在问题。我们可以看到一些示例JRXML吗?我想为html格式设置如下无分页符:查看模板设计中的设置
Ignore Pagination
是否适合您。您好,它工作得很好。但是reportConfig.setRemoveEmptySpaceBetweenRows(true);不工作。我需要设置此参数。我需要一个具有类似功能的函数reportConfig.SetRemoveEmptySpace BetweenRows(true);不仅设置了无分页符。