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

Show hide with Table


PP Ocean
Go to solution Solved by jgust,

Recommended Posts

Hi 

Does Jasper Studio support show/ hide functionality with Table component? I am creating a report from studio. I need to show/hide table based on parameter.

For example, I have 2 input controls (A&B) and 2 tables (Table1 & Table2). 2 tables are created with in single JRXML with 2 separate datasets. When I select any value in Input Control A, Table 1 should be visible and Table 2 should hide. Similarly, When I select any value in Input Control 2, Table 2 should be visible and Table 1 should hide.

Table 1 and Table 2 are created using seperate datasets, and parameter A passed to Table 1 and parameter B passed to Table 2. I knew show/ hide will work at column level but not sure whether it is possible with table. I have tried various methods but didn't work.

Does anyone know how to achieve this?

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Solution

Let's say you have a boolean parameter called $P{ShowTableA} with a default value of 'true'.

    <parameter name="ShowTableA" class="java.lang.Boolean">        <defaultValueExpression><![CDATA[true]]></defaultValueExpression>    </parameter>[/code]

Depending on the value of that parameter you can use the "Print When Expression" on the subreport to suppress or show it.

 

This condition will Show Table A
 

$P{ShowTableA}.equals( true )[/code]

 

This condition will show Table B
 

$P{ShowTableA}.equals( false )[/code]

 

Link to comment
Share on other sites

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