I want to restrict the values in multi-select input control in my report based on the logged in user. For example, If manager logs in, he can see the list of all employees in the multi-select list. If an employee logs in, he will see only his name on the list. What is the best way to do that?
Try to add a new parameter "LoggedInUser" which will give you the LoggedIn User ID and then you can pass this parameter in where clause of the query
<parameter name="LoggedInUser" class="com.jaspersoft.jasperserver.api.metadata.user.domain.User"/>
<parameter name="FullUserName" class="java.lang.String">
<defaultValueExpression><![CDATA[$P{LoggedInUser}.getFullName()]]></defaultValueExpression>
</parameter>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With