简体   繁体   中英

Java Jasper Reports iReport

I am having a problem in using a iReport.

I have a general master report and that master report contains 3 sub reports and also these each subreports contain subreport. While I am not having a problem in printing those 3 subreports individually and also their subreports in the preview mode of iReport, I can't print them while they are together in the master report in the preview mode. I have included all the parameters and fields needed for executing the query in every reports (I mean the subreports and their master report). However, no way! It doesn't work...

Any help will be greatly appreciated...

I've seen this happen a few times, the preview wouldn't work, but when I tried to run the report from the application in my local workspace everything ran fine. I think the issue may be that the subreport doesn't have data and that causes problems. You may want to add print when expressions to the subreports so they don't run unless there's data.

The solution to the problem is to generate the sub reports from scratch, not by copying and pasting the similar report. In my case, the sub reports in the report look very much similar in many patterns so I have just copied one of them, pasted them on the main report and changed what is needed to be changed (such as fields, names or the queries inside them) on the pasted sub report. At first sight, while I am previewing the sub reports independently from their main report, they just look fine but while I am trying to preview the main report, the sub reports in the main report are not printed. So I accidentally (those times I were a novice user of the iReport) tried to generate the sub reports from scratch. (Scratch I mean: File -> New -> Launch Report Wizard -> Selecting the database I'd like to work on and entering the query which I'd like its results to have the datum to be printed on the report and so on) and by magic; the sub reports which are seemed to be not working, begin to work and get printed on their main report.

Thanks for all the replies...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM