yananderson Posted August 2, 2012 Share Posted August 2, 2012 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 repositoryStep 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 More sharing options...
patrick.dewitt Posted August 15, 2013 Share Posted August 15, 2013 Hi,I want to thank you. It is very clear and it works fine.Kind regards,Patrick Link to comment Share on other sites More sharing options...
raja.shekar Posted November 19, 2014 Share Posted November 19, 2014 @yanandersonI am trying the same method to create a pie chart using html5 chart in iReport.However i am getting the top10 records from the domain dataset But i need top10 records by countwise in a column.Please help me on that... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now