有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java无法删除行之间的空白

我想将报告导出为html格式,并使用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);

共 (0) 个答案