Issue:
[toc on_off::hide=1]
Customer has a report designed in Jaspersoft Studio, in which there is a table that uses its dataset (subdataset). For this subdataset customer has defined a variable. Now he wants to display the value of this variable in report itself, outside the table. Which means he needs to pass the variable value from sub dataset to main dataset. Which is impossible by default. Customer receives error "You drop an object from a subdataset into the report": http://prntscr.com/n2mezy
Resolution:
In order to pass variable value from sub dataset to main dataset, you have to define variable in main dataset with calculation System:
<variable name="Counter" class="java.lang.Integer" calculation="System"/>
Now you should add returnValue property into datasetRun section like below. It takes fromVariable (the one from subdataset) and toVariable (the one from main dataset):
<datasetRun subDataset="Dataset1" uuid="b793d24c-3ae9-4ded-b083-ff57b900a2b8"> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <returnValue fromVariable="Total Summary" toVariable="Counter"/> </datasetRun>
See report attached.
Recommended Comments
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 accountSign in
Already have an account? Sign in here.
Sign In Now