views:

219

answers:

2

Hello good people!
I've tried to use chart in ireport for the first time.I've used a bar chart and anytime i preview the chart i see plenty of them, i think about 6.I only need a single one is there anything that i didn't do?
i have a query like this :

SELECT COUNT(*) AS total_message ,`status` , DATE_FORMAT(date_created,'%M') AS `month` FROM message WHERE YEAR(date_created)=$P{year} GROUP BY `status` , MONTH(date_created) ORDER BY `status` DESC

and i have a result like

|total message | status | month       |
|1             | FAILED | January     |
|10            | SENT   | Febuary     |
|11            | SENT   | March       |
|123           | SENT   | April       |
|156           | FAILED | May         |
 ..........

up to december. my serie expression is set to ${Status}
categorie expression is ${month}
value expression is ${total_message}

can somebody help me ? thanks for reading this!

+2  A: 

You didn't provide any code, but I have a guess: you have put the chart in the details band, and you are printing it for each record in your DataSource. Put the chart in a non-repeatable band.

Bozho
+1  A: 

yup, the above answer from Bozho is right. i just moved the chart into the Summary band and the chart is only showing up once. Thank you!

Lawrence Leung