Jump to content

Passing a php variable value to JS report


ronedog

Recommended Posts

Please forgive me if this is a basic questino...new to jasperserver and evaluating the functionality to see if we can make it work for our application...any tips will be helpful, or if you can point me to the right documentation to read that would help.

is it possible to pass a variable from php to a report in JS?  For example, in my php application I keep the department_id stored in a session variable.  I would like to pass the department_id over to my reports running on JasperServer and display the information appropriate for that department.  in the iReport I have a query like: "SELECT * FROM employees WHERE department_id = $P{dept_id_from_php}", but I have to build a dropdown select list, which doesn't keep security the way we need it to be.

The end result is I would like the user logged into my PHP application to view the employee information that is related to the department the logged-in-user belongs to.  I don't want to pass this over using the querystring because the user could just change the id in the querystring and have access to other departments information, which violates a security parameter.

Thanks for the help.

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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