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

Friday, April 04, 2014

Tip - Playing with variable in report bands - Summation of a query column using variable in jasper iReport in Title, Column Header and other bands

Hi Guys,

This is very useful tip in jasper iReport to calculate the summation of query columns using variables. 

* This way of summation reduces the SQL/other language code to calculate the column summation with in it.  i.e., 
* Faster and simpler and easy understandable. 

* To sum the the SQL query column value, you just need to drag and drop the column field from Fields section of Palette. 

* When you drag and drop, the iReport engine in the back end creates variable with the properties.
  Find images 1 and 2 for the above point. 

* This way of drag and drop of column summations will work in Title band, Column Header,Footer, Page Header and Footer band. 

* The other way is you can directly create your own variable by specifying the properties which will not work in the Title, Column/Page Header/Footer bands but works  only in Summary band with Reset type change. 

You can find a different value in column footer & summary for own created variable. 

* So it is recommend to drag and drop when you need column summations in the bands.  

* Even though if you give the same properties for your own variable it'll give Null value except in Summary band with Reset type change. 

* Also note that , the variable in Detail band will not work. Detail band will fall into loop(repetition) and this is the case you are finding summation value.(A single value). 

* Not checked with other Calculations while dragging and dropping but hope will work in the same way.

:-) :-) :-)

Specialist in BI

No comments:

Post a Comment