Reports Sections Controlled by Input Control

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

Report’s sections controlled by input control

Requirement: In this blog, I am going to discuss how we can enable/disable the different sections of the jasper report through input control.

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

Grab The 30 Days Free Trail

Solution overview: In main report I am using two subreports which will be linked to input controls through print when expression. Let us discuss in detail how we can achieve this.

Detailed Solution:

  1. Create main report in jasperstudio. Here I am considering you know how to create report in jasper.
  2. Again create two subreports in main report and linked to already existing reports.
  3. After done with steps 1 & 2,create parameter in main report as “reportsection”:blog-1
  4. In ‘print when expression’ of subreports, type the expression as shown in screenshot below:blog-2 
  5. Similarly, update the ‘print when expression’ of subreport2.
  6. Create input control on server:

    a.Type: Multi select list of values.

    b. Name the input control as “Report Section” and parameter name should be same as in report parameter. Here it is “reportsection”.

      c. In tab “Edit list of Values”, provide the name and value.Value will contain the name of   subreport file name.e.g,

  •       subreport name: sample1.jrxml,
  •       subreport name: sample2.jrxml
  •       Name: “Sample 1”and Value: “sample1”
  •       Name: “Sample 2”and Value: “sample2”
    b3

b5

b5

  1. Link the input control with main report on jasperserver.

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

Click Here to Free Download

  7. On executing report you’ ll be able to show and hide the subreport sections of the report on click of input control. Refer the screenshots below:b7

b8

b9

Hope it helps!!

Thanks,

Nisha Sahu

logo

Best Open Source Business Intelligence Software Helical Insight is Here

logo

A Business Intelligence Framework

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