开发者

JasperReports: unrecoverable multipage subreports

For example i have Master report that contains several multipage subreports. I want t开发者_JAVA百科hem to be displayed in order that is set in master report (prints the first subreport and then prints second). When i add these subreports into master datail band, they cover each other.

How can i do such thing?

Thank you


Have you tried putting each subreport in its own detail band? Or, if you're putting the subs in an array, include another variable like "reportName" or "reportNumber" and group the subreport detail bands by that variable, so each time the variable changes a new group is created for the new subreport. Doing it that way would also let you put a group header for each subreport which you could then customize with variables and/parameters. Just a thought.


I found the satisfied solution: i fill all my reports separately, but export them by JRPdfExporter:

            List jasList = new ArrayList();
            jasList.add(jp_1);
            jasList.add(jp_2);
            jasList.add(jp_3);
            JRPdfExporter exporter = new JRPdfExporter();
            exporter.setParameter(JRExporterParameter.JASPER_PRINT_LIST, jasList);
            exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "batch.pdf");
            exporter.setParameter(JRPdfExporterParameter.IS_CREATING_BATCH_MODE_BOOKMARKS, Boolean.TRUE);
            exporter.exportReport();

They will be ordered in list order and bookmarks will be generated

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜