0
votes

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...

2
What you are trying to do is feasible. You can have any number of subreports. Try first to run a report with just one subreport correctly. If it works then make a report with one subreport that contains a subreport.Costis Aivalis
Dear Costis, that's what exactly I am trying to accomplish. I have already run a report with its subreport correctly then I moved on to one more level further and tried to run that report in its super or master report. However, I got stuck...Faruk Postacioglu
I see... What error message do you get?Costis Aivalis
At first, I didn't receive any error messages just an empty page, but later on I added a dummy query to the master report which previously doesn't have and I began to receive error messages about the sub report's query. I think this is misleading because when I am prewiewing the subreport individually, it is printing what I want.Faruk Postacioglu
Error filling print... net.sf.jasperreports.engine.JRException: Error executing SQL statement for : bultenRaporuAltinDetayStandartDisiSubReportFaruk Postacioglu

2 Answers

0
votes

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.

0
votes

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...