Jump to content
Changes to the Jaspersoft community edition download ×

returning values from subreport


2005 IR Help

Recommended Posts

By: craig b spengler - craigbs

returning values from subreport

2004-03-03 13:44

i have been unable to implement td's "tips & tricks" example #6 -- "returning values from subreport".

 

the first code segment, which is to be applied to the master report:

 

<parameter name="ReturnedValuesMap".....

....</parameter>

 

throws "Incompatible value assigned to parameter ReturnedValuesMap: MasterReport"

 

Can you pls post a full-blown (simple) example of master.xml and subreport.xml as an example of how to do it?

 

Of additional interest would be an example of the scriptlet implementation of the pass-back, also.

 

mtia

 

 

 

 

 

By: craig b spengler - craigbs

RE: returning values from subreport

2004-03-06 06:10

ok, found out what i was doing wrong; now i am bumping my nose into the (apparent) fact that variables cannot be updated from the "passed-back" hashtable data.

 

it seems as if the only thing you can do with the hashtable data is either print/display it or have a scriptlet massage the data.

 

have i got that correct? i'd love to hear opinions!

 

 

 

 

 

By: craig b spengler - craigbs

RE: returning values from subreport

2004-03-07 13:33

well, i am convinced (mucho hours later) that trying to assign $P HashMap results to a $V just doesn't work!

 

after getting a somewhat complex report working fine and printing the $P values directly-addressed in text fields -- i added an assignment of the same HashMap element to an unique $V and the result was a totally corrupted table! (All data objects in the table are BigDecimal, reset/evaluation times were set the same.)

 

am i all wet? why can't i assign a parameter's value to a variable?

 

mtia

 

 

 

 

 

By: David Lim - aberrant80

RE: returning values from subreport

2004-03-07 18:02

I'm not too sure what your problem is but it could be that the assignment was done at the wrong time, before proper internal initialisation?

 

Anyway, to pass values back from a subreport, I somehow think that it's actually to simply put in a key-value pair into the SAME parameter map given to the subreport by the main report. The main report can then simply read from the map after the subreport is done with it.

 

 

 

 

By: craig b spengler - craigbs

RE: returning values from subreport

2004-03-10 19:36

Thanks for the comment, David --

 

after fiddling around awhile, i found out that if i just use one parameter map and pass it around to all of the subreports (and main) and keep it updated (e.g. with a detailGroup) then i essentially have a Global Common area.

 

shame on me! nonetheless, it works, and is very predictable, and since i am using scriptlets heavily then i can always make abundant use of System.out's

for debugging.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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