Jump to content
We've recently updated our Privacy Statement, available here ×

Unbale to draw Chart in JasperStudio


rajesh.kulkarni2000

Recommended Posts

I am new to JasperReports / JasperStudio and struggling a bit with Charts. The experts may find it very primitive and it is possible that I could be missing some very basic stuff here.. Here is a brief of what I am trying to do

1) Data source is csv with following fields

Sr_No,

URI,

total_time_taken,

no_of_requests,

avg_time_per_req,

most_expensive_req,

timestamp_of_exp_req

2) The csv has around 40,000 lines in it

3) I want to create a report which has all the 40,000 lines in it (A simple columnar report based on all the fields, sorted by no_of_requests in descending order). This is piece of cake in JasperStudio !

4) Next, I want a summary page with "top 10" URIs in a pie chart where value of the pie series is no_of_requests and key is URI (Pretty straight forward)

 

I have created a report in JasperStudio with data source as csv. I have selected all the fields and applied no filter to my query for the primary dataset (i.e. the default dataset that I get while creating the report). This helps me print all the 40,000 lines in the "Details" band of the report...so the first part is taken care off.

 

For summary page I need a pie chart where my challenge is to get "top 10" records from the entire dataset. Thankfully my "top" criteria is based on no_of_requests field and my data is already sorted based on that field. Still, I need a subset of the data to draw a meaningful chart. To achieve this, I tried to create a new dataset with just two fields, the URI (which is the key for the Pie) and no_of_requests (which is the value). I also applied  filter expression "($V{REPORT_COUNT} > new Integer(10)) ? false : true" to the my new dataset so that I get "top 10" records from my already sorted data. I verified that the filter is working correctly by running it in "Data Preview" tab of "Dataset and Query" dialogue. I have chosen the new dataset as the "Dataset" for my Pie chart..

 

When I run the report (in preview mode of JasperStudio), I get 40,00 0 lines printed corrected (in the Details band) but the summary is empty. It draws no pie chart.

I tried same with a Bar Chart, but result is the same. The summary in that case shows just X and Y axis with no data points. The graph is empty.

 

 

Am I missing something?

 

Any help in this regards will be highly appreciated.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...