1 report 2 pie charts

Anyone here familiar with Jasper Reports iReport?

I am fairly new to it, I am trying to create a report with two pie charts

The data source is

---------

select COUNT(*) as ROWCOUNT, WORKSTREAM, REASON

from TABLENAME where RECORDTYPE = 'Y'

and DATESTAMP BETWEEN $P{FromDate} AND $P{ToDate}

group by WORKSTREAM, REASON

----------

 

I am trying to get first pie chart to count WORKSTREAM value and %

and the second on the same page to display REASON value and %

 

One pie chart always displays correctly the other doesn't

ben.rattigan's picture
Joined: May 14 2013 - 2:13am
Last seen: 7 months 5 days ago

1 Answer:

My assumption for your example is, that you cannot do a group by query like you do it. Should there be a count(*) for workstream, and a count(*) for reason?

I would advise to use two datasets (right-click report root in Report Navigator and select "Add dataset"...) with two single queries and connect them to your pie chart. That should be a clear, clean and easy approach.

Cheers, Thomas

http://www.thomaszimmer.net

P.S.: To increase reusabilty (if it makes sense in your context), you could also implement  each pie in a simple subreport...

Thomas Zimmer's picture
Joined: Oct 2 2012 - 1:35am
Last seen: 9 hours 51 min ago

Thanks, the sub data set worked great. The only problem I am having now is that the labels wont display as %. In designer mode it shows as set to % using {2} but when I preview the report the label names are still on the pie chart.

ben.rattigan - 9 years 8 months ago
Feedback
randomness