Jump to content

Make Visible a Subreport's Data


shaunw

Recommended Posts

Hi there. Murray here. I need to create a sort of "hyperlink" such that when a button is clicked below a chart, the data displays below it.  You have a "Show Data" button which when the data displays, toggles to "Hide Data" and vice versa.

Many thanks

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I've done that trick before by adding the data table (using the table component) and leveraging the Print When Expression of Jasper reports.

Create a Parameter (e.g. ParamShowTable) and default that to 0. In the table (or subreport) that prints the data table add a Print When Expression that checks for the parameter (e.g. $P{ParamShowTable} == 0 )

The just create a report execution type Hyperlink that executes the same reportand changes the value of the parameter fro  0 to 1

Link to comment
Share on other sites

Yet again, back to the basics. I have created the parameter and am isolating the test to showing or hiding a subreport. I set the "Initial Value Expression" of this parameter to "0" (in quotes), and "Variable Class" to "java.lang.String". No other properties are changed. In the subreport element within the main report, I set the "Print When Expression" to ($P{ShowClientSummary}.equals(“1”) ? Boolean.TRUE : Boolean.FALSE), yet the subreport shows in the preview. What have I done/not done?

I'm most grateful for your time.

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