Lets share love

How ? copy url of this blog and share in your social network :) simple

Lets share love

How ? copy url of this blog and share in your social network :) simple

Tuesday, December 31, 2013

Charts in iReport

Creating charts that is pie-chart , bar diagrams is very easy. you can create fascinating charts in minutes with iReport.

With following steps you can create awesome looking and accurate charts with iReport. Here is am going to discuss about creating a pie-chart.

1. Create a new report.

2. Remove all bands except detail and summary band . we will put pie-chart in summary band.

3. Now write a query to get your data from database. In my case :

                 select count(*)as count , district from user_information group by district 

where count(*) will count the no. of rows that contain particular district and put value in 'count'

user_information is my table name .


Now drag fields to the detail band and preview the report.




you should get a preview similar to following :

this means there are 2 record that have baglung in district columns and 1 record that have bara in district column and so on .

Now in properties of count field change field class to integer. as follow:
after then drag chart tools from palette window to the summary band. A window will appear click next. then a another window appears here you have to select unique identifier and and its numeric value. so on first option select the field that you want to be the name of the slice. here in my case district will be the slices. 

i made count as integer so this will be the numeric value of district slice. 
after this finish the wizard. after then resize the chart size that you need to be displayed. Now its time to see the output . Your should get preview somewhat like below image.

for more resource visit following :




Count(*) and Count(column_name) in SQL

Count (*) returns numbers of rows with in the table 

And 

Count (Column_name) returns numbers of rows which contain the that particular column . 

Monday, December 30, 2013

sum of columns in iReport , jasper reports

okay today i am working on jasper reports and tool to design jrxml file iReport.

So on this post i will help you to sum up all the integers of the columns.

first of all you have to fetch data from datasource by writing query.

now yo have a column that you want to sum .

now yo need to create a variable . for that right click on variable. as in following image.
name the variable as SUM . now set following poperties to the SUM. 
now drag the variable SUM to the page footer band. and you will see the sum .

hope this helps