Why wont my sub-report work?

Hi Guys,

I am new to iReport. 

I currently have a report that works. I have a sql query and a Sybase Database connection, I am using one paramter, I know of which will return a result set form my query.

I want this report to now act asa sub-report. So dag and drop in the subreport object into the Detail band. Use the wizard to specify the report i want to use, I specify 'use the same  connection used to fill the master report', I also have made a paramter identicle the one i have in the subreport and pair the expression to the parameter name, then finally specify to use "$P(SUBREPORT_DIR) + reportname" durign the subreport exp step as I want to then move it to JasperServer.

OK,so now I have the subreport object is in the detail band.

So i click preview to run the master report, It asks me for the parameter (which - I hope have specified to be passed to the subreport)

BAM "The document has no pages"

Thanks for any helpful advise.
ps. I do notice there is an XML backing to all of this but, if you do post anything related to XML, I am most likely to not understand what you want me to do unless you are very clear :)

Thanks Again,

bdaetgibson's picture
Joined: Nov 15 2012 - 4:34pm
Last seen: 10 years 2 weeks ago
Click on the subreport element and be sure that: 1.) The subreport expression is pointing to the correct place 2.) The connection type is "Use a connection expression" 3.) That the connection expression is set to ${REPORT_CONNECTION} Also be aware that you will need to use the 'repo:/path/to/report' syntax once you deploy them to the server. -Kris
kcollins - 10 years 4 months ago
Hey Blake, I am sure you must ensured that the Main-Report SQL returns some kind of result-set else if it doesn't, the detail band will be empty, hence nothing would be printed including the sub-report. If the Sub-report paramters do not accept any values from the Main Report-SQL dataset, you might want to move the sub-report to the Summary band. Either ways, do make sure that your Main-Report SQL does return some kind of dataset. Let me know if this works. -Jatin
jatinb - 10 years 4 months ago
kcollins: I am very sure I have all these set properly. jstinb: I tried it, and no luck :(
bdaetgibson - 10 years 4 months ago

1 Answer:

OK, this is going to sound really silly!
You ahve two levels of reports: The main one, and the subreport.
even though the main one tries to access the subreport, for anythigng to return form the subreport, the main report needs its own independant result set!

bdaetgibson's picture
Joined: Nov 15 2012 - 4:34pm
Last seen: 10 years 2 weeks ago