So we are trying to set up input controls for our reports that would allow up to get the LoggedInUser's user attributes. To give a little bit of context, we are using external authentication, and the user attributes we are using corrsepond to a collection of ids that we can add to join/where clauses in the input control queries. We also custom utility class that allows us to parse the user attributes and transform them into an sql-safe list (for in statements and whatnot, because the raw attribute value is just a comma seperated string of ids).
What I would expect I'd need for this to work is something like this in the jrxml:
Then that I would be able to access that userLinkedBriefIds from the input control query like:
select briefid, brief_name from alchemy.dbo.brief bwhere b.activestatus like 'A%'and (b.briefname_alias = '' OR b.briefname_alias is null)and (b.parentid is null)and b.briefid in $P!{userLinkedBriefIds}order by b.brief_name asc[/code]
But, the input control doesnt even load in the report and we get an error in the logs with a stacktrace like this (abbreviated since its pretty long)
2013-10-01 14:31:17,466 ERROR GenericExceptionMapper,http-8080-5:42 - Unexpected error occurs net.sf.jasperreports.engine.JRRuntimeException: Parameter "userLinkedBriefIds" does not exist. at net.sf.jasperreports.engine.query.JRAbstractQueryExecuter.checkParameter(JRAbstractQueryExecuter.java:787) at net.sf.jasperreports.engine.query.JRAbstractQueryExecuter.appendParameterClauseChunk(JRAbstractQueryExecute r.java:464) at net.sf.jasperreports.engine.query.JRAbstractQueryExecuter.appendQueryChunk(JRAbstractQueryExecuter.java:373 ) at net.sf.jasperreports.engine.query.JRAbstractQueryExecuter.parseQuery(JRAbstractQueryExecuter.java:358) at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.<init>(JRJdbcQueryExecuter.java:139) at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.<init>(JRJdbcQueryExecuter.java:147) at com.jaspersoft.jasperserver.api.engine.jasperreports.util.JRTimezoneJdbcQueryExecuter.<init>(JRTimezoneJdbc QueryExecuter.java:127) at com.jaspersoft.commons.util.JSControlledJdbcQueryExecuter.<init>(JSControlledJdbcQueryExecuter.java:65) at com.jaspersoft.commons.util.JSControlledJdbcQueryExecuterFactory.createQueryExecuter(JSControlledJdbcQueryE xecuterFactory.java:26) at net.sf.jasperreports.engine.query.AbstractQueryExecuterFactory.createQueryExecuter(AbstractQueryExecuterFac tory.java:49) at com.jaspersoft.jasperserver.api.engine.jasperreports.util.JRQueryExecuterAdapter.executeQuery(JRQueryExecut erAdapter.java:92) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.executeQuery(EngineServ iceImpl.java:2117) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616)
I'm able to get the value of the report parameter from the actual report (by either putting it into a text field or by actually using it in the report query), but from the input control its just not working.
Has anyone tried anything similiar and had success?
How to get LoggedInUser parameter from Input Controls
in Products
Posted
Hi,
So we are trying to set up input controls for our reports that would allow up to get the LoggedInUser's user attributes. To give a little bit of context, we are using external authentication, and the user attributes we are using corrsepond to a collection of ids that we can add to join/where clauses in the input control queries. We also custom utility class that allows us to parse the user attributes and transform them into an sql-safe list (for in statements and whatnot, because the raw attribute value is just a comma seperated string of ids).
What I would expect I'd need for this to work is something like this in the jrxml:
Then that I would be able to access that userLinkedBriefIds from the input control query like:
But, the input control doesnt even load in the report and we get an error in the logs with a stacktrace like this (abbreviated since its pretty long)
I'm able to get the value of the report parameter from the actual report (by either putting it into a text field or by actually using it in the report query), but from the input control its just not working.
Has anyone tried anything similiar and had success?