Passing Parameters From Crosstab To Subreport In Jasper

Posted on by By Ramu Vudugula, in Business Intelligence, Jaspersoft, Open Source Business Intelligence | 0

Passing Parameters From Crosstab Report to Drill-Down Report In Jasper Studio

Scenario: I have created a crosstab report and When user clicked on measure it should open a another details report by passing the same parameters being selected in crosstab report

Prerequisites:
Jasper Studio Workbench
Jasper Server
Database: Postgres – Foodmart

Make data easy with Helical Insight.
Helical Insight is world's best open source business intelligence tool.
Click Here to Free Download

Main Report

  1. Created a cross tab report having Region and area as row groups, month wise store cost, sales units as measures with Region and Area as parameterscrosstab1
  1. Created Region and Area parameters in main report sectioncrosstabparam1
  2. Create same parameters inside the cross tabcrosstabparam2
  3. While creating parameters in crosstab, if you are facing any issue then add parameters from source code

    <crosstabParameter name=”Region” class=”java.util.Collection”/

    <crosstabParameter name=”Area” class=”java.util.Collection”/>

    Drill Down Report

    1. Create a detailed report having few columns and add region, area and month as parametersdrilldownCase: Whenever user clicked on a measure in the main report, it should take respective region, area and month values and it should render drill down report with selected values.
      1. Add Hyperlink properties to measures in the cross tab main report

      Click on element, in properties pane click on hyperlink, change values of link target to blank and link type to reportExecution. Click on parameters and add parameters.

      Make data easy with Helical Insight.
      Helical Insight is world's best open source business intelligence tool.
      Grab The Free Trail

      Add drill down report path in _report and region, area and month parameters

      crosstabdrill

    2. Run the report in interactive mode and check click icon will be displayed on the measures and click on that. It should open drill down reportcrosstabhyperHyperlinks are displayed in blue color. Click on measure it will open drilldown report but selected input control parameters values are not passing from main report to subreportTo handle this case, we have to add one property in main cross tab reportClick on crosstab element in outline pane, Open properties and click on crosstab

      There is one attribute named as Parameters Map Expression.

      Enter $P{REPORT_PARAMETERS_MAP} inside the expression

      crosstabprop

      Save and run the report.

      Now Click on measure hyperlink, it will load drill down report

      Main Report – Cross tab

      – Clicked on Sales column in January Month, CA area and USA Region

      crosstab1

      Drill down report

      – Getting January, CA and USA as parameters from the main report

      Make data easy with Helical Insight.
      Helical Insight is the world’s best open source business intelligence tool.

      Click Here to Free Download

      drilldown

logo

Best Open Source Business Intelligence Software Helical Insight is Here

logo

A Business Intelligence Framework

Thanks,
Ramu Vudugula
BI Developer

2 3 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments