How to collate multiple jrxml jasper reports into a one single pdf output file

后端 未结 5 686
一个人的身影
一个人的身影 2020-11-30 08:06

I have to prepare reports using five different sql queries. Each query will give out one report table.

So I wrote 5 jrxml files each corresponding to one of the abov

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-30 08:30

    (iReport example)

    Part I:

    • create a new blank jasper report as a wrapper report for different reports
    • data adapter = One empty record - Empty Rows
    • click "New..."
    • choose "empty rows"
    • click "next"
    • number of empty records = 1 (so you will simulate on record and only ONE detail band will be printed)
    • so the blank report is ready When you call this report out of your JAVA program, first open a data connection to the database and exchange this connection in the background. SubReports of our wrapper report can inherit this connection via parameters!

    Part 2)

    • add for every report you want to embed a new detail band.
    • each detail band contains a subreport (link to the other standalone report of course)
    • set the property "run to bottom" to "True" in the subreport definition of our wrapper report

    this concept works for me. depending on parameters, you can switch different bands on or off, of course.

提交回复
热议问题