I'm working in a report which needs to be attached to another to generate a bigger report, so it only has title, page footer and summary sections. The problem is that I'm getting a compilation error and I don't know the reason. This is my jrxml
file (parts with ...
omitted for brevity):
<?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>
Trying with Jaspersoft Studio I was getting an error but couldn't see the trace, so I made a little routine in Netbeans and the stack trace I'm getting is:
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)
The line from my code (the last in the stack trace) is this:
String myReport = JasperCompileManager.compileReportToFile("myReport.jrxml");
(the file exists and the path is correct)
My first thought was that pageHeight - (topMargin + bottomMargin) < 650px
but it turns out that is not the case, in fact is 656px
so I don't know what I'm missing. Any help or guide is welcomed.
I tried removing <pageFooter>
just for test (I can't do it in the final report, it contains some info) and the report compiles and renders smoothly. Besides, I can say that no element is outside the band because it's made with Jaspersoft Studio and that kind of error is shown in the design view.
Any other info about the report source code please let me know in the comments.