shaunw Posted November 5, 2012 Share Posted November 5, 2012 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 More sharing options...
marianol Posted November 5, 2012 Share Posted November 5, 2012 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 More sharing options...
shaunw Posted November 13, 2012 Author Share Posted November 13, 2012 I'm really sorry to have to elaborate, but changing a parameter value seems quite elusive to me. I've experimented, googled and searched, but cannot get that working. What mechanism do I use to do it? Link to comment Share on other sites More sharing options...
shaunw Posted November 13, 2012 Author Share Posted November 13, 2012 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now