# Variable returns null/blank at first row in report

Go to solution Solved by alfie1109,

## Recommended Posts

Hi All-

I have variables that does some calculation

First Variable:  Adds all Discounts (Discounts Column)

Name:  Discounts_Total
Variable Class:  java.lang.float
Calculation:  SUM
Reset Type:  Group
Reset Group:  Group ID
Increment Type:  None
Increment Group:  blank
Variable Expression:  Float.parseFloat(\$F{Discounts})
Initial Value Expression:  0

Second Variable:  Return the Highest Total for each Group ID (Discounts Column)

Name:  Discount_TotalGrp
Variable Class:  java.lang.float
Calculation:  Highest
Reset Type:  Report
Reset Group:  blank
Imcrement Type:  Page
Increment Group:  blank
Variable Expression:  \$V{Discounts_Total}

The Result:  First row is blank, it should be \$119.95 first and then so on and so on.......

 ID NAME DISCOUNTS 1 FOOD [blank, should be 119.95 here and then so on... so on...] 2 FOOD SPCL 119.95 3 BEVERAGES 0.00 4 LIQUOR 2.20 5 BEER BTL 15.30 6 BEER SPCL 2.50 7 WINE 0.00 8 BEER DRAFT 0.00 TOTAL 139.95

Any ideas on why the value returns to the second row instead of first row?

Thanks!

~a

• Replies 3
• Created

#### Popular Days

The order of variables matters. Make sure that the first variable is placed before the second variable.

##### Share on other sites

@hozawa, the variables are correctly set in placed, and still didn't work.

##### Share on other sites

• Solution

I set the following variables in order and set each variable (see below)

Name = Discounts_Total
Variable Class = java.lang.float
Calculation = Sum
Reset Type = Group
Reset Group = Group ID
Increment Type = None
Increment Group =
Variable Expression = Float.parseFloat(\$F{Discounts})

Name = Dsct_TotalGrp
Variable Class = java.lang.float
Calculation = Highest
Reset Type = Group
Reset Group = Group ID
Increment Type = Group
Increment Group = Group ID
Variable Expression = \$V{Discounts_Total}

On the text field properties:

Text Field Expression:  \$V{Dsct_TotalGrp}

Change Evaluation Time and Group

Evaluation Time =    Group
Evaluation Group =  Group ID

After I made the following changes, report works!!!!!