Jump to content

Recommended Posts

Posted

I am trying to read a parameter value and getting error

The 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)
    WHERE

1=1 and
    CASE WHEN  $p{totalEmployees}<1000 THEN $X{IN, name,a}
          ELSE $X{IN, name, b}
END AND
   2=2

Is there any syntax problem?

 

 

 
 
  • Replies 1
  • 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...