I am working with my company's project. It uses Java Spring and Jaspersoft ireport 3.7.6 to print report.
I want to modify an exist report form (file jrxml). I want to sum a variable of 2 columns.
Data of these columns like
0/2/3/0
0/2/3/0=5
0/0/0/1
0/0/0/1=1
I have to calculate total of numbers which is behind '='.
I followed the solution in How to sum all values in a column in Jaspersoft iReport Designer?
I created a "GRAND_TOTAL" variable with caculation: "Sum", Class: "java.lang.Integer", resetType:"Report", incrementType:"none"
I added this condition to variableExpression
new Integer(($F{FullQty}.contains("=")) ? (Integer.valueOf($F{FullQty}.split("=")[1]).intValue() + Integer.valueOf($F{EmptyQty}.split("=")[1]).intValue() ) : (0))
When I print report, it shows error :
net.sf.jasperreports.engine.design.JRValidationException: Report design not valid :
1. Variable not found : GRAND_TOTAL
Please help me!
question from:
https://stackoverflow.com/questions/65841702/jaspersoft-ireport-variable-not-found 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…