mapfish-print icon indicating copy to clipboard operation
mapfish-print copied to clipboard

Print fails with legend bigger 1 page

Open svades opened this issue 7 years ago • 4 comments

As soon as the legend gets bigger / higher than one page (A4) the print fails. We are using MPF 3.10.4 on GMF 2.2.0.

svades avatar Dec 04 '17 09:12 svades

Your legend is probably in a page header, and the page header can't be in more than one page...

sbrunner avatar Dec 04 '17 10:12 sbrunner

No, the legend is at the correct place. The legend in the specific case results in a 274x1335px size png and that's simple to heigh to fit into a page (701px taking Header etc into account)

The error message in catalina out:

net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.design.JRValidationException: Band height validation for subreport "map" failed in the current page context (height = 842, top margin = 28, bottom margin = 20) :
         1. The noData section and the margins do not fit the page height.
        at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:878)
        at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:352)
        at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:421)
        at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:396)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2063)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:755)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:262)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:122)
        at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:555)
        at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:414)
        at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:122)
        at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:583)
        at org.mapfish.print.output.AbstractJasperReportOutputFormat.getJasperPrint(AbstractJasperReportOutputFormat.java:223)
        at org.mapfish.print.output.AbstractJasperReportOutputFormat.print(AbstractJasperReportOutputFormat.java:94)
        at org.mapfish.print.MapPrinter.print(MapPrinter.java:125)
        at org.mapfish.print.servlet.job.PrintJob$1.run(PrintJob.java:90)
        at org.mapfish.print.servlet.job.impl.FilePrintJob.withOpenOutputStream(FilePrintJob.java:31)
        at org.mapfish.print.servlet.job.PrintJob.call(PrintJob.java:87)
        at org.mapfish.print.servlet.job.PrintJob.call(PrintJob.java:32)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:622)
        at java.lang.Thread.run(Thread.java:748)
Caused by: net.sf.jasperreports.engine.design.JRValidationException: Band height validation for subreport "map" failed in the current page context (height = 842, top margin = 28, bottom margin = 20) :
         1. The noData section and the margins do not fit the page height.
        at net.sf.jasperreports.engine.fill.JRFillSubreport.verifyBandHeights(JRFillSubreport.java:1094)
        at net.sf.jasperreports.engine.fill.JRFillSubreport.validateReport(JRFillSubreport.java:1053)
        at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:476)
        at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:351)
        at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:281)
        at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:504)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2029)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:755)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportContent(JRVerticalFiller.java:282)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:126)
        at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:555)
        at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:414)
        at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:738)
        at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:58)
        at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:216)
        ... 3 common frames omitted


![legenderror](https://user-images.githubusercontent.com/29245949/33648231-290fcddc-da59-11e7-878c-a979357d73d6.PNG)

you can inspect the used jrxml here: https://github.com/camptocamp/baselstadt_mapbs/blob/master/print/print-apps/mapbs/Basel_Stadt_A4_Portrait.jrxml

svagap avatar Dec 06 '17 06:12 svagap

Where can I see your print template?

sbrunner avatar Dec 06 '17 07:12 sbrunner

https://github.com/camptocamp/baselstadt_mapbs/blob/4f787261a73a7e3df107774e1a6e28554859418b/print/print-apps/mapbs/config.yaml.mako#L15

svagap avatar Dec 06 '17 07:12 svagap