Jump to content
JasperReports Library 7.0 is now available ×

Field from dataset pass as parameter to subreport


grimm11

Recommended Posts

I have a main report using a Dataset.  I think have a List that uses a sub-dataset.  In that sub-dataset I have a field returned that I want to pass to the sub-report as part of one of the parameters.  Is there a way to do this?  

Currently, if I do the Edit Parameters I can only see values from the main report and I don't see any values from the sub-Dateset that is used to populate the list.  I tried to figure out of the Parameters Map Expression would work, but that does not work either.

Any assistance is appreciated.

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

I would like to begin by declaring that I may not understand your question.
Therefore, please understand that it may not be helpful as an answer.

* Assumptions of the report structure

main_dataset
 --> parameters > Param_main
 --> Variables > Variables_main

w20211123_main_dataset.png.9254faa5c07bcd54480ebee989e7b1e1.png

 

 

sub_dataset
 --> parameters > Param_sub
 --> Variables > Variables_sub

w20211123_sub_dataset.png.1f59daf63df5ce2f9658631e006df1ad.png


* Case1:main --> sub

list > Dataset > prameters
The setting here passes 'Param_main' to 'Param_sub'.

w20211123_list.png.d89df735229691d4518471959bcdde1b.png

w20211123_list_prameters.png.9c6218d4b96cfd927ebbbc53d0b1eb6c.png

 

* Case2:main <-- sub

list > Dataset > Return Valus
The setting here returns 'Variables_sub' to 'Variables_main'.
w20211123_list_returnvalus.png.bbf1cf16e124be84cae076bfc023cd10.png

w20211123_variables_sub.png.8fc34a67813c067b834630eca90037b9.png

Note that you need to be aware of the 'Evaluation Time'.

w20211123_variables_main.png.999b9d8f8c546dfc27d4e9b4bdd72547.png

 

Preview image.

w20211123_preview.png.a37143255d42899b8ad865b1b38d7fb3.png

I hope this is useful to you.

 

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