alfie1109 Posted July 26, 2018 Share Posted July 26, 2018 Hi All-I have variables that does some calculationFirst Variable: Adds all Discounts (Discounts Column)Name: Discounts_TotalVariable Class: java.lang.floatCalculation: SUMReset Type: GroupReset Group: Group IDIncrement Type: NoneIncrement Group: blankVariable Expression: Float.parseFloat($F{Discounts})Initial Value Expression: 0Second Variable: Return the Highest Total for each Group ID (Discounts Column)Name: Discount_TotalGrpVariable Class: java.lang.floatCalculation: HighestReset Type: ReportReset Group: blankImcrement Type: PageIncrement Group: blankVariable Expression: $V{Discounts_Total}The Result: First row is blank, it should be $119.95 first and then so on and so on.......IDNAMEDISCOUNTS1FOOD[blank, should be 119.95 here and then so on... so on...]2FOOD SPCL119.953BEVERAGES0.004LIQUOR2.205BEER BTL15.306BEER SPCL2.507WINE0.008BEER DRAFT0.00TOTAL 139.95Any ideas on why the value returns to the second row instead of first row? Thanks!~a Link to comment Share on other sites More sharing options...
hozawa Posted July 28, 2018 Share Posted July 28, 2018 The order of variables matters. Make sure that the first variable is placed before the second variable. Link to comment Share on other sites More sharing options...
alfie1109 Posted July 30, 2018 Author Share Posted July 30, 2018 @hozawa, the variables are correctly set in placed, and still didn't work. Link to comment Share on other sites More sharing options...
Solution alfie1109 Posted August 1, 2018 Author Solution Share Posted August 1, 2018 I set the following variables in order and set each variable (see below)Name = Discounts_TotalVariable Class = java.lang.floatCalculation = SumReset Type = GroupReset Group = Group IDIncrement Type = NoneIncrement Group = Variable Expression = Float.parseFloat($F{Discounts}) Name = Dsct_TotalGrpVariable Class = java.lang.floatCalculation = HighestReset Type = GroupReset Group = Group IDIncrement Type = GroupIncrement Group = Group IDVariable Expression = $V{Discounts_Total}On the text field properties:Text Field Expression: $V{Dsct_TotalGrp}Change Evaluation Time and GroupEvaluation Time = GroupEvaluation Group = Group IDAfter I made the following changes, report works!!!!! 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