Jump to content
Changes to the Jaspersoft community edition download ×

Top 10 biggest results chart in Ireports using Domain dataset.


yananderson

Recommended Posts

So I've had the challange to create a top 10 biggest resutls chart using a domain driven dataset.  After a fair bit of searching I've managed to scrape together enough knowledge to do this but thought I'd put my findings here in one place so others can re-create this.

Step 1 - Create full dataset chart in jasper reports adhoc editor.

Step 2 - import chart into ireports frmo jasperserver repository

Step 3 - modify chart to show max 10 records.  Right click report, choose chart data.  under the dataset tab choose the filter expression memo field and add the following code: new Boolean($V{REPORT_COUNT}.intValue()<=10)

Step 4 - add a sort field to the report to sort by your charts measure. The sum of your measure will actually be stored as a field so this can be used to sort the chart reliably.  Do this by clicking the icon to enter details on the report query and choosting sort options from the bottom of the popup.  Then add field and choose the field that is used by your reports measure and set ti as Descending.

This should be all that is necessary to create a top 10 results chart.  I've attached the JRXML and an example output to assist in anyone who wants to follow this.



Post Edited by yananderson at 08/02/2012 11:34
Link to comment
Share on other sites

  • 1 year later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...