Jump to content
We've recently updated our Privacy Statement, available here ×

Getting value of one parameter value to another parameter in jasper server


anandh.nr

Recommended Posts

Hi,

I have 2 parameters

1. <parameter name="PAYMENT_METHOD" class="java.lang.String">

<defaultValueExpression><![CDATA[new ArrayList<String>(Arrays.asList("ALL ORDERS","CREDITCARDS ONLY","PURCHASE ORDERS ONLY"))]]></defaultValueExpression>
</parameter>
 

2. <parameter name="PAYMENT_METHOD_CONDITION" class="java.lang.String" isForPrompting="false">

<defaultValueExpression><![CDATA[$P{PAYMENT_METHOD}.equals("PURCHASE ORDERS ONLY")
? " payment_method=PURCHASE_ORDER' "
: $P{PAYMENT_METHOD}.equals("CREDITCARDS ONLY")
? " payment_method='CREDITCARD' "
: "]]></defaultValueExpression>
</parameter>
 
here
 
I have used PAYMENT_METHOD parameter value in PAYMENT_METHOD_CONDITION parameter for making some condition to use in the query.
 
Then I will add PAYMENT_METHOD_CONDITION parameter value directly in the query  as below
 
   select * from revenue_by_currency where $P!{PAYMENT_METHOD_CONDITION }
 
it WORKS FINE in the iReport.
 
But not working in jasper server. PAYMENT_METHOD_CONDITION parameter always returns ""(empty string) because PAYMENT_METHOD parameter always returns defult value, not returning the value
which is entered/selected by an user at runtime while evaluating  PAYMENT_METHOD_CONDITION parameter .
 
Can anybody help on this?
 
Thanks,
Anandh.
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hi anandh,

See the issue which I see here is that, you are not using proper input types in the Jasperserver.

The arraylist parameter you have used would be a list of values in the Jasper Server, and also the parameters you have used in the report are all of type String which would be vary from arraylist to a  collection, whichever suits your purpose.

 

You need to recheck the parameter types which you are using.

Hope that this helps

Thanks 
Ankur gupta
http://ankurthetechie.blogspot.in/

 

 

Link to comment
Share on other sites

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...