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

How do I pass a list of values from HTLM5 Pie chart slice hyperlink?


sraylewis

Recommended Posts

Hey everyone,

I'm trying to create a simple set of two reports as follows:

1) Sales by Country
This report is a pie chart with each country as a bucket, slice size is a distinct count of customer IDs in that country. I'm trying to create a measure hyperlink that will pass a title string and a list of customer IDs to the second report. Source data has two columns: Country and Customer ID.

2) Customer List
This report is a simple list of customer information by customer ID. This report contains two parameters: "Title" is a string, and "Select_Customers" is a collection. The SQL query is a simple 'SELECT [customer info] WHERE $X{IN, customerID, Select_Customers}, and there is a text field on the page

Both reports have been created in Jaspersoft Studio and loaded to Jaspersoft Server for viewing.
Report 1 loads properly, showing the pie chart as expected. The hyperlink to Report 2 seems to work, except it launches the report and passes all customer IDs (not just the list of IDs for that country). As well, the 'Title' string is being passed as 'null'.

As an example, my pie chart slices have the following values:
Canada: 10 customers
USA: 15 customers
UK: 5 customers

Expected behavior:

When I click on the 'Canada' slice, report 2 loads with title 'Canada' and a list of 10 records.

 

Actual behavior:

Regardless of slice clicked, report 2 loads with a title of 'null' and a list of 30 records.



The pie chart (HTML5) is configured as follows:

1 category level (Country); Expression = $F{Country}

No series level

1 Measure (CustomerCount); Calculation = DistinctCount, Value Expression = $F{CustomerID}

Associated Hyperlink (on Measure): Hyperlink Target: Self, Hyperlink Type: ReportExecution

Hyperlink Parameters: Title [seriesItemHyperlink], Use Bucket Value (Country); Select_Customers [seriesItemHyperlink], Use Expression ($F{CustomerID}); _report (irrelevant, it's loading the second report)


I've also tried adding a Bucket Property to category Country where the Property = 'IDs' and Expression = $F{CustomerID} - this gives me the same result.


I know that I can handle this by passing the Country to Report 2 and adding a 'WHERE Country = $P{Country}' to the query, but I'm hoping to use the customer report for multiple purposes; e.g. I might have another pie chart that shows customer count by account executive that passes 'AccountExecName' to $P{Title} and a separate list of customer IDs to $P{Select_Customers}.

Ultimately my goal is to have one 'Customer List' Report that accepts customer IDs and Titles from any other report, and handle the filtering and aggregation in the other reports. How can I pass just the list of customer IDs that correspond to my clicked slice?

 

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