Jump to content
Changes to the Jaspersoft community edition download ×

Pass Subreport Return Var to Another Sub?


2004 IR Help

Recommended Posts

By: Johnny A - sykosity

Pass Subreport Return Var to Another Sub?

2005-12-16 15:26

I have a master report and several subreports. I am able to return a value from one of the subreports and use it in my master report and this works okay.

 

I would like to be able to pass the variable returned from the first subreport as a parameter to one of the other subreports. Is this possible? I can't seem to get it to work - I get a null value when the other subreport displays it.

 

My master report variable is of calculation type System.

 

The value that I am returning from the first subreport is of calculation type Sum.

 

The text field in the second subreport which displays the parameter passed from the master has evaluation time Report.

 

Am I doing something wrong or are there alternative ways to accomplish what I'm trying to do?

 

Thanks in advance,

John

 

 

 

 

By: Lucian Chirita - lucianc

RE: Pass Subreport Return Var to Another Sub?

2005-12-18 15:12

Hi

 

Are the two subreports parts of the same band? That would explain why the value returned from the first subreport is not available in the second one, because the subreport parameter value expressions are evaluate at the beginning of the band filling, and value is returned from the first subreport later.

 

If this is the case, you could use the old way of returning a value from a subreport, using a map )or something else) to place the value to be returned into and then retrieving the value from the map.

 

Another solution would be to split the band using dummy groups.

 

HTH,

Lucian

 

 

 

 

By: Johnny A - sykosity

RE: Pass Subreport Return Var to Another Sub?

2005-12-18 20:09

Thanks Lucian.

 

You were correct about my subreports being in the same band. I created two dummy groups and put each subreport into the footer band of the dummy groups which solved my problem.

 

I now have a better understanding of how JasperReports works when filling reports. Thanks for the advice.

Link to comment
Share on other sites

  • 3 years later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

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