PHP variable passed to JasperServer for reports
Posted
by Ronedog
on Stack Overflow
See other posts from Stack Overflow
or by Ronedog
Published on 2010-04-21T21:59:00Z
Indexed on
2010/04/21
22:03 UTC
Read the original article
Hit count: 356
Is it possible to pass a variable from php to a report in JasperServer? 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 to pass the dept_id parameter.
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. Ideally I would like to only pass that parameter once, then reuse it in all the reports, like a global variable.
Is this possible?
© Stack Overflow or respective owner