Return Values in Jasper Reports

Posted on by By Nikhilesh, in Business Intelligence, Jaspersoft, Open Source Business Intelligence | 0

Return Values from Sub Dataset to Main Dataset in Jasper Reports

Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.

Lets Start Free Trail

Sometime it is required to return values from sub dataset to main report dataset but due to bug in the jasper studio we are unable to it. Please refer this bug link
http://community.jaspersoft.com/jaspersoft-studio/issues/4746

Steps to return values from sub dataset to main report dataset

1) Create two variable one in subreport dataset (lets say SubDataset_Var) and one in main report dataset (lets say MainDataset_Var).

2) Suppose this sub dataset is used by table component. Click on table component and goto properties window (dataset tab) it will show you below screen

returnvalue

3) Click on return values button it will open one pop up window , see the below image

return_values

In above image, you can see instead of MainDataset_Var it is showing SubDataset_Var in “To Variable”. So now in “From Variable” just put the MainDataset_Var name. then click ok.

It will add follow line in JRXML file

Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.

Lets Register For Live Demo

<returnValue fromVariable="MainDataset_Var" toVariable="SubDataset_Var" incrementerFactoryClass=""/>

4) Open source of JRXML and replace the fromVariable value to toVariable value and vice versa and remove the incrementerFactoryClass=””.

<returnValue fromVariable="SubDataset_Var" toVariable="MainDataset_Var"> 

Now you can use MainDataset_Var in your main report.

Note : Change the Evoluation Time of component in which you are going to use main dataset variable.

logo

Best Open Source Business Intelligence Software Helical Insight is Here

logo

A Business Intelligence Framework

3.5 2 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments