Jump to content
We've recently updated our Privacy Statement, available here ×

Dynamically calling subreports, compiling subreports in iReport


quiwi

Recommended Posts

Edit: Added iReport to title, Issue resolved. Thx.

 

Hi, I'm curious if someone can give me some advice on how to accomplish a task. I am trying to load multiple subreports based off some of my field data. Each subreport is unique and there's ~15 or so possible subreports. (Basically, I'm compiling a summary report for individuals with various subsections depending on which tests they took.)

 

I naively tried to designated the subreport as:

<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + $F{testName} + ".jrxml"]]></subreportExpression>

Of course this failed when I compiled the report:

Unable to locate the subreport with expression: "$P{SUBREPORT_DIR} + $F{testName} + ".jrxml"".

 

Any ideas how I could change this around so that it wouldn't fail when compiling? Is it possible to give jasper reports an entire list of subreports to compile and set a flag somewhere to skip the compilation of subreports?

 

(also a side question)

I tried putting a page break within a list, but I wasn't able to get it to work. Instead I loaded a subreport and placed the page break within the detail section with no problems. Is there anyway to do this within a list? As it is right now, I have a subreport that only contains one section with a line break and a nested subreport.

 

Thanks!



Post Edited by quiwi at 04/12/2012 15:48
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Well, I'm an idiot, first I forgot to specify that I was asking about iReport. Secondly, under options->Compilation and execution there's a checkbox "Compile Subreports (if can be found).

 

Thanks ejhellerattc, I assume you mean just placing a bunch of subreports one after another and toggling them with a printwhen expression. That would also work, but now I'm no longer having any problem with my report.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...