I created a subreport with no parameters. I found the subreport didn't display as expected. If run the subreport itself, it does display.
Here's the iReport screenshot.
The following picture is the FileSafe Backup Report I'm currently using. I'm trying to migrate to JasperReports.
Thanks advance for any help.
Post Edited by ageofjava at 05/10/2010 09:36
Post Edited by ageofjava at 05/10/2010 09:43
Taras, thanks very much for your kind help.
The subreport uses the same connection as the master report, the local FileSafe-Backup-20100330-162507-001-129144110565671150.xml file. I created the subreport and the master report separately and then add the subreport to the master by dragging the "Subreport" icon from the palette. I didn't sepcify any parameters for the subreport.
I thought the subreport already had its own data source. Should I pass a data source to it from the master report?
You can run the report after simply downloading the 3 attachments to a same folder. filesafebackup.jrxml is the master report, clientsnotbackedup.jrxml is the subreport and FileSafe-Backup-20100330-162507-001-129144110565671150.xml is the data source used by both the reports.
Post Edited by ageofjava at 05/11/2010 03:06
When you create sub report the wizard should appear.
In mentioned wizard on the step2 please select appropriate connection (from the master report or create a separate one).
On the step 3 do not forget to pass some parameters from master report to the sub report if needed.
Hope that will help.
P.S. Cannot find attachment. Please upload it once more if it won't help.
The attachments are located at the bottom of the thread #74189. Please search the string "Attachments:" in this page. You'll see the 3 attachments right below the highlighted "Attachments:".
Thanks again for your kind help.
I investigated the problem you have.
First of all, correct the name of sub report to clientsnotbackedup.jasper. But that's the minor issue.
Also don't forget to pass parameters from master report to sub report. This is done in parameters property of sub report element. Select it and press copy from master and
choose needed parameters. One is for sure needed - SUBREPORT_DIR.
The main issue: you have not set the data source for the sub report.
To do that:
- select your subreport element.
- change connection type to "use a data source expression"
- change data source expression to
- the path "/report/client[@status='never']" was taken from yours subreport query, correct it if needed
- run the master report
- that worked for me. If it will work for you - add some karma points :)
The solution works for me. Thanks a lot for your continuous help. Because the sub report used the same local xml file as the master one, I selected the option "use the same connection as the master report". It was wrong.
For sure, you got your karma points