I am trying to build a report with multiple columns. I have a column total
that represents the summation of the previous columns.
However, the value I am getting is of type BigDecimal
and the return type of the .add
method is BigDecimal
and not integer, for example: 12.00 and I want it to be shown as only 12 in the report.
Here is my code:
TextColumnBuilder<Integer> col1 = col.column("Locked Users" , "Locked" , DataTypes.integerType());
TextColumnBuilder<Integer> col2 = col.column("Unlocked Users" , "unlocked" , DataTypes.integerType());
TextColumnBuilder<Integer> col3 = col.column("Failed Logins" , "invalid" , DataTypes.integerType());
TextColumnBuilder<Integer> col4 = col.column("Forgot Password" , "Passforget" , DataTypes.integerType());
TextColumnBuilder<BigDecimal> col5 = col1.add(col2).add(col3).add(col4).setTitle("Total");
How can I do it?