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

Subreport Return Value


JulEgner

Recommended Posts

  • Replies 17
  • Created
  • Last Reply

Top Posters In This Topic

Check the subreport sample in the JR distribution (or online at http://www.jasperforge.org/images/documentation/jasperreports/samples/MasterReport.jrxml) to see some examples of returning values from subreports.

 

If you want to sum the values returned from the subreport, all you need to do is to specify the calculation type:

Code:
<returnValue ... calculation="Sum"/>

 

HTH,

Lucian

Link to comment
Share on other sites

Thanks a lot..

I solved this Problem by setting the calculation Type in Subreport(Others)/Subreport Return Value AND in the description of the Variable.

 

But now I have another Problem.. I have a Subreport in the detail area. This Subreport gives a return Value to the Main Report. Now I want to give this Value to the Subreport in the next detail (of the next Dataset).

 

I Want to give so data from a subreport to the main Report to the subreport.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 years later...

Do you know how to transfer a value from subreport to main report?

In main report, I define a variable subFee(BigDecimal) and in subreport, I define a variable fee(BigDecimal), the question is when I use <returnValue subreportVariable="fee" toVariable="subFee"/>, it always show null even if there is a valid value in subreport.

How to resolve it? I test in both ireport 2.5 and ireport 3.5.

Please let me have your feedback.

Thanks a lot.

Link to comment
Share on other sites

jiechu
Wrote:

Do you know how to transfer a value from subreport to main report?

In main report, I define a variable subFee(BigDecimal) and in subreport, I define a variable fee(BigDecimal), the question is when I use <returnValue subreportVariable="fee" toVariable="subFee"/>, it always show null even if there is a valid value in subreport.

How to resolve it? I test in both ireport 2.5 and ireport 3.5.

Please let me have your feedback.

Thanks a lot.

I already use evaluated time "Band".

Link to comment
Share on other sites

  • 1 year later...

Hi there,

I have linked a subreport to the main report and display the subreport value in the main report. However, I need to use the data from subreport to do calculation in main report. Can anyone advice me how do I go about it? Thank you.

Link to comment
Share on other sites

  • 2 years later...
  • 7 months later...
  • 3 weeks later...

Hi All,

I would like to ask all of you about the same thing but a little bit different.

I have linked a subreport to the main report like the others do, and want to show it in detail band (main report), and like you said before, I have changed the evaluation time to "Band". But, when i try to preview, it turned out showing null. Later, I want to calculate this return value in main report and of course showed in detail band too. Can anyone advice me how i do this problem? I hope i could get the answer as soon as possible. Thank you a lot.

Sorry if my english is a little bit off.

Link to comment
Share on other sites

  • 8 months later...

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