问题描述:

My database query fetches list of data like:

 id key noc date

1 abc 4 1-10-2016

2 abc 12 2-10-2016

3 abc 23 3-10-2016

4 abc 2 4-10-2016

5 def 23 1-10-2016

6 def 44 2-10-2016

7 def 12 3-10-2016

9 def 43 4-10-2016

10 def 43 5-10-2016

abc and def made those no of calls on those dates.

I want to display these data in chart.

But I am fetching this data with a single query, and I want to create 2 charts , one for abc and another for def.

How can I create multiple charts in jaspersoft with single query and making a single chart? As the number of persons making the call can be different , and I will have to create a chart for every person.

网友答案:

When creating or modifying each chart you just need to link them back to the relevant dataset. This can be either the main report dataset or a sub-dataset created just to run the charts.

You only need to follow the instructions on the relevant jaspersoft wiki page and link each new chart back to the required dataset.

Regards,

网友答案:

For getting multiple charts from a single query you need to do :

  1. First create a jasper report, and add a subreport to it. ( Make sure to make the layout growable and the width of the main group should be larger than the subgroup)
  2. Create the dataset
  3. Create Group on right clicking the report from outline panel.
  4. Provide a group name by selecting a column.
  5. Add a expression pointing the column which is grouping the data.
  6. And select reset on group .
  7. Don't forget to set the evaluation time and the evaluation group

For example :

<chart evaluationTime="Group" evaluationGroup="KeywordGroup">
相关阅读:
Top