anandh.nr Posted September 2, 2014 Share Posted September 2, 2014 Hi,I have 2 parameters1. <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 valuewhich 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 More sharing options...
Ankur Gupta Posted September 3, 2014 Share Posted September 3, 2014 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 helpsThanks Ankur guptahttp://ankurthetechie.blogspot.in/ Link to comment Share on other sites More sharing options...
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