jrxml
...
为简洁起见省略):
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport ... pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="469" leftMargin="70" rightMargin="56" topMargin="130" bottomMargin="56" isSummaryWithPageHeaderAndFooter="true" ...>
<property ...some properties.../>
<parameter .../>
<queryString language="SQL">...</queryString>
<field .../>
<variable>...</variable>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="650" splitType="Stretch">...</band>
</title>
<pageFooter>
<band height="50">...</band>
</pageFooter>
<summary>
<band height="451">...</band>
</summary>
</jasperReport>
Exception in thread "main" net.sf.jasperreports.engine.design.JRValidationException: Report design not valid :
1. The title section, the page and column headers and footers and the margins do not fit the page height.
at net.sf.jasperreports.engine.design.JRAbstractCompiler.verifyDesign(JRAbstractCompiler.java:280)
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:152)
at net.sf.jasperreports.engine.JasperCompileManager.compile(JasperCompileManager.java:357)
at net.sf.jasperreports.engine.JasperCompileManager.compileToFile(JasperCompileManager.java:273)
at net.sf.jasperreports.engine.JasperCompileManager.compileToFile(JasperCompileManager.java:232)
at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:542)
at ar.edu.unt.jasper.ReportCompilerAndExporter.main(ReportCompilerAndExporter.java:25)
我的代码(堆栈跟踪中的最后一行)是这样的:
String myReport = JasperCompileManager.compileReportToFile("myReport.jrxml");
(文件存在,路径正确)
我的第一个想法是
pageHeight - (topMargin + bottomMargin) < 650px
但事实并非如此,事实上是这样
656px
所以我不知道我错过了什么。欢迎任何帮助或指导。
<pageFooter>
只是为了测试(我不能在最终报告中这样做,它包含一些信息)和报告编译和呈现顺利。此外,我可以说没有任何元素在乐队之外,因为它是由Jaspersoft Studio制作的,这种错误在设计视图中显示。