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

checimovic

Members
  • Posts

    10
  • Joined

  • Last visited

checimovic's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. Yes, I set it to System. However, I've solved the issue. You have to pass the main report's variable as a parameter, with the value expression like $V{mainVariable}. Then the subreport can change it as it likes, sort of like it's a global variable. Strange that return values didn't work. I used this to get a TOC to work with many subreports. Now each subreport runs the same scriptlet the main report does. To get the page numbering correct, I pass in the main report's current page as a parameter, then in the scriptlet I do: Code:// Get the current subreport's page. Integer pageIndex = (Integer)this.getVariableValue("PAGE_NUMBER"«»); // Get the current main report page. Integer currentPage = (Integer)this.getParameterValue("currentPage"«»); // Calculate the real page number of the subreport. Integer realPage = currentPage + pageIndex - 1;
  2. I've narrowed it down to this: If I define a String variable in a subreport (call it subStr) and initialise it with Code:new java.lang.String("test"«») and have this return to a variable called mainStr in my main report, all is well. If I set the string in a scriptlet executed by the subreport, like this: Code:[code]String newStr = new String("scriptlet-test"«»); this.setVariableValue("subStr", newStr); the change does not make it back to the main report - mainStr is null. I've set my evaluation time to band, etc. Any ideas?
  3. In my main report, I have a java.util.ArrayList for generating a table of contents (taken from the sample). I want to pass this into my subreport for it to add some TOC entries also. I pass it in as a parameter, and in my subreport, I declare it as: new java.util.ArrayList((java.util.ArrayList)$P{HeadingsCollection}) So now the subreport's ArrayList is initialised with the main report's ArrayList value. After the subreport has finished putting values into it, I return it as a normal subreport variable. However, the main report does not pick up the new values. Any ideas?
  4. 1. In your main report, create a couple of group bands, AGroup and BGroup. 2. Create subreports with your A.csv and B.csv queries. Make sure they run okay (at the very least, compile them). Put these into the AGroup and BGroup. 3. Run your main report, which is empty other than containing the two subreport elements. If you search this forum under "subreports", you'll find lots more info.
  5. Ha, thank you - I did all that, but I was forgetting to set the Top property in the subreport to 0! Now it works. Okay, now I have to figure out how to generate a table of contents ;) You've been very helpful so far, but if you feel like typing some more, please feel free to share some pointers on setting up a nice toc.
  6. Thanks for the good advice. I was able to get the band heights down to 5 without the subreports getting moved around. However, this required really careful placement with the mouse. How did you get the band heights down to 1? When I set the band properties, the subreport gets moved. Is there some way to add subreports to group bands without having to drag and drop?
  7. Thanks very much for your response. Multiple groups works well, except when I hit 10 or so groups - then the design page runs out of room, and any new groups become 0 height. If I try setting existing groups with subreports in them to have 0 height, the subreports get bumped up to the next band (for example, the column header band). Any ideas?
  8. I think I figured it out...if I give the main report a bogus query (select * from sometable) and add no fields to the detail section, I can put the subreports in there and they print sequentially, without acting as detail reports. What a hack, though. It would be nice if whatever was put into the detail band of the main report would just print regardless of whether or not the detail band has a query attached to it.
  9. I think I figured it out...if I give the main report a bogus query (select * from sometable) and add no fields to the detail section, I can put the subreports in there and they print sequentially, without acting as detail reports. What a hack, though. It would be nice if whatever was put into the detail band of the main report would just print regardless of whether or not the detail band has a query attached to it.
  10. I have around a dozen subreports each consisting of a complex SQL query. They all work fine. I want to display them one after the other in an empty main report, which will simply act as a container for them. When I place the subreports in the detail band of the main report, they don't show up. When I put them into the column header band, they do show up (once I set the "AllSectionsNoDetail" property). Is it okay to place all the subreports in the column header band? Why don't they show up in the detail band? Sorry for the silly questions, but I'm pretty new to iReport. Thanks, Chris
×
×
  • Create New...