NG Posted September 9, 2015 Posted September 9, 2015 I am trying to read a parameter value and getting errorThe server has encountered an error. Please excuse the inconvenience. Here's the parameters I have<parameter name="totalEmployees" class="java.lang.Number" isForPrompting="false"> <defaultValueExpression><![CDATA[$P{REPORT_PARAMETERS_MAP}.get("employees").size()]]></defaultValueExpression> </parameter><parameter name="a" class="java.util.List" isForPrompting="false"> <defaultValueExpression><![CDATA[$P{totalEmployees} > 1000 ?$P{REPORT_PARAMETERS_MAP}.get("employees").subList(0,1000):$P{REPORT_PARAMETERS_MAP}.get("employees")]]></defaultValueExpression> </parameter> <parameter name="b" class="java.util.List" isForPrompting="false"> <defaultValueExpression><![CDATA[$P{totalEmployees} > 2000 ?$P{REPORT_PARAMETERS_MAP}.get("employees").subList(1000,2000):$P{REPORT_PARAMETERS_MAP}.get("employees").subList(0,1000)]]></defaultValueExpression> </parameter>I am trying to read the totalEmployees value and based on that I am trying to decide whether to use paramter a or b in the in statememnt:Here's the where clause. (1=1 and 2=2 are just to show that there are other conditions) WHERE1=1 and CASE WHEN $p{totalEmployees}<1000 THEN $X{IN, name,a} ELSE $X{IN, name, b}END AND 2=2Is there any syntax problem?
grafro Posted September 10, 2015 Posted September 10, 2015 could you please post your whole report (jrxml)?(inside a code block :) )
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