nahian35 Posted June 21, 2016 Share Posted June 21, 2016 In main report I have A,B,C three field, I passed value of A to sub report variable using a parameter and calculate it with a value then return it to main report variable B. Everything is working fine but the problem is: its returning only the last value of list in B. I want full list in B. How can i solve it ? Link to comment Share on other sites More sharing options...
joseng62 Posted June 28, 2016 Share Posted June 28, 2016 In you sub report, when you drag variable B onto the detial band, does it generate multiple values row for row? (First need to test that variable B is working as expected. You could have a sequence or order issue.If B is working as expected. Maybe build an array in your subreport with values from B and then pass over the array(parameter) to main. First you need to create parameter, let call it Array.Class java.util.ArrayListDefault Value Exp = new ArrayList()Untick promptingThen create Variable: Array_addValue class : java.lang.BooleanExpression: !$P{Array}.contains(B) ? !$P{Array}.add(B) : null (This ensures no duplications,)Calculation: No CalcIncrement type : NoneReset Type: ReportThen create 2nd variable: Array_buildValue class : java.util.ArrayListExpression: $P{Array}Calculation: SystemIncrement type : NoneReset Type: NoneYou might need to do some parsing depending on class of your values. Then return value to main by mapping your $P{Array} sub to a parameter in main. Link to comment Share on other sites More sharing options...
Recommended Posts
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