Jaspersoft BI Tools

iReport,Jaspersoft Design Studio,Jaspersoft Server, Schema Workbench,Analysis,Dashboards, Self Service BI, Domains,Topics,Ad-Hoc Reports, Jaspersoft ETL, Embedding BI,HTML-5 charts, Fusion Charts,JFree Charts,Drill down reports , Drill down Dashboards,Visualize.js, Performance Tuning, D3 Charts, Jaspersoft Customization

Tuesday, November 03, 2015

Tip : Adding Big Decimals in Jasper Reports

Hi ,

We can use below expression to add Big Decimals in Jasper Reports. 

new BigDecimal(
    ($F{unit_sales_1}==null ?new BigDecimal(0).doubleValue():$F{unit_sales_1}.doubleValue() )+
    ($F{unit_sales_2}==null ?new BigDecimal(0).doubleValue():$F{unit_sales_2}.doubleValue() )+
    ($F{unit_sales_3}==null ?new BigDecimal(0).doubleValue():$F{unit_sales_3}.doubleValue() )
)


References : 
http://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html


Thanks,
Sadakar