0
我想創建一個多列的報告。我有一列total
,它代表了以前的列的總和。動態報告BigDecimal
不過,我所獲得的價值是BigDecimal
類型和.add
方法的返回類型是BigDecimal
而不是整數,例如:12.00,我希望它顯示爲只有12個報告。
這裏是我的代碼:
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");
我該怎麼辦呢?
你可以例如:BigDecimal b = new BigDecimal(「12.00」)'然後在int中使用'b.intValue()' – Omoro
這是在正常的java中,它不會適用於動態報告中的列 –
我不知道動態報告,但可以使用Big整數而不是BigDecimal。像這樣的東西應該給你格式選項我猜... – AxelH