Jump to content
Changes to the Jaspersoft community edition download ×

Cant pass multiple values as input control at jasperserver


dimdimitrako
Go to solution Solved by asimkin,

Recommended Posts

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

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution

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&reportUnit=/reports/report_name&output=pdf&j_username=jasper_user&j_password=jasper_password&rep_parm=parm_value

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&reportUnit=/reports/report_name&output=pdf&j_username=jasper_user&j_password=jasper_password&rep_parm=parm_value_1&rep_parm=parm_value_2&rep_parm=parm_value_3

 
Hope this helps
Link to comment
Share on other sites

 

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?
 

Link to comment
Share on other sites

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!

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