Cant pass multiple values as input control at jasperserver

Hello experts,

I am using Apex 4.2, jasperserver and ireports 5.6.0. I have in report query $X{IN,column,packs_parameter} as ireport's parameter and 'java.util.Collection' as type to pass multiple values separate by comma. In ireports the parameter pass values (example 'value1,value2,value3') without problems. Report run perfect. At jasperserver i have input control as multi select query and i can choose more than one values.  But with this jasperserver way i lose my initial target. Apex pass values like above example and the report not running with more than one value as parameter. Is there any solution to pass more than one value to jasperserver's input control split by comma?

thank you in advance,

Dimitris

dimdimitrako's picture
Joined: Apr 16 2015 - 6:43am
Last seen: 5 years 9 months ago
 

Hello asimkin,



Thank you for your time.
I dont have particular problem with apex. My main problem is the way to pass multiple values to report. Inside jasperserver. I try multiple query but not work for me. I want something like a text area to pass values seperated by comma. Ireports run perfect with multiple values and comma. I dont understand why jasperserver cant work like ireport. So is there any solution to pass values seperated with comma?
 

dimdimitrako - 8 years 1 week ago

Hello dimdimitrako,

A few days ago i was working on a report that allow me write some coma separated values in jasperserver, what i did was create a new string input control in jasperserver, this one is where you wiill write you separated values, then i had to create a couple of parameters in ireports, lets say parameter1 as java.util.List with the default value expression defined like Arrays.asList($P{Parameter2}.split(",")), the parameter2 is a java.lang.String type.

The created input control on jasperserver have to be linked to parameter2 where you will receive the string with the coma separated values, now with the Arrays.asList($P{Parameter2}.split(",")) you will separate your original string where the "," is found and fill the list parameter that you can use within your query.

I hope this can be useful to you.

Regards!

MikeM19 - 8 years 6 days ago

Hello MikeM19,

 Your answer look interesting. But in report query, inside ireport in where clause, i must have a 'in' type, a '$P!{parameter)' type?

Regards!

<span class="pun">$</span><span class="pln">P</span><span class="pun">!{</span><span class="pln">qparam_TickerValue</span><span class="pun">}</span><span class="pln"></span>
<span class="pun">$</span><span class="pln">P</span><span class="pun">!{</span><span class="pln">qparam_TickerValue</span><span class="pun">}</span><span class="pln"></span>
<span class="pun">$</span><span class="pln">P</span><span class="pun">!{</span><span class="pln">qparam_TickerValue</span><span class="pun">}</span><span class="pln"></span>

dimdimitrako - 8 years 6 days ago
show 2 more...

You are AWESOME. i test it with $X{IN,column,packs_parameter} way and it works.. Thank you very much Mike. You made my day.

dimdimitrako - 8 years 6 days ago

You're welcome dimdimitrako, i'm glad to know i was useful on this one.

Regards!

MikeM19 - 8 years 5 days ago

1 Answer:

Hi,
I'm not familiar with Apex in details but from what I found out, Apex calls JasperReports server reports using HTTP API like

http://jasperreport-server/jasperserver/flow.html?_flowId=viewReportFlow...

If this is the case, to pass multiple values for a parameter, you should include it multiple time in the call:

http://jasperreport-server/jasperserver/flow.html?_flowId=viewReportFlow...rep_parm=parm_value_1&rep_parm=parm_value_2&rep_parm=parm_value_3

 
Hope this helps
asimkin's picture
27801
Joined: Jun 16 2014 - 6:30am
Last seen: 2 years 10 months ago
Feedback
randomness