dc137654 Posted July 26, 2007 Share Posted July 26, 2007 I apologize if this is already answered in a different section but is there a simple way of controlling section visibility to certain users of a report? For example, this is what I want to do:1)In an application, a user clicks on a printer friendly page which passes the User ID as a report parameter2)In the report, certain sections will be restricted to certain users (access is controlled in the report based on role, which is stored in our database). Is this even possible? Thanks in advance,Derek Link to comment Share on other sites More sharing options...
codyjasperForge Posted July 26, 2007 Share Posted July 26, 2007 If the userID is coming in as a parameter, you could use it inside of the specific bands 'Print when Expression'. Remember, this has to evaluate to a Boolean expression though. It could possibly look something like: new Boolean ($P{userID}.equals("value")) If you need to check for multiple values, then nest another ternary expression inside of the first. Like so: $P{userID}.equals("value1") ? Boolean.TRUE : ($P{userID}.equals("value2") ? Boolean.FALSE : ($P{userID}.equals(etc...))) Remember to close your parenthesis' at the end also...Does this help? Link to comment Share on other sites More sharing options...
dc137654 Posted July 27, 2007 Author Share Posted July 27, 2007 Thanks Cody, I will try that. Actually, instead of userID, I will pass the user role instead. That should do the trick. Thanks for the help!Derek 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