philippw Posted June 15, 2017 Share Posted June 15, 2017 Hallo everyone,we started working with jasperreports and use the jrs-rest-java-client libraries to create our reports. We now stumbled across a problem using an java.util.ArrayList as a parameter within an IN-clause:select *from tablenamewhere$X{IN, tablename.columnname1, pListParameter}and tablename.columnname2 = $P{pAnotherParameter}[/code]It works fine with the default expression for the pListParameter in jaspersoft Studionew ArrayList(Arrays.asList(new String[]{"Smith","Miller","Bush"}[/code]So the report uses the correct IN-clause and therefore the parameter.Now when i try to pass an ArrayList in Java (using the above mentioned jrs-rest-java-client library), single parameters get passed fine, but the ArrayList is not working. Part of the java code is:import com.jaspersoft.jasperserver.dto.common.PatchDescriptor;import com.jaspersoft.jasperserver.dto.resources.ClientReportUnit;import com.jaspersoft.jasperserver.jaxrs.client.core.JasperserverRestClient;import com.jaspersoft.jasperserver.jaxrs.client.core.RestClientConfiguration;import com.jaspersoft.jasperserver.jaxrs.client.core.Session;import com.jaspersoft.jasperserver.jaxrs.client.core.enums.AuthenticationType;import com.jaspersoft.jasperserver.jaxrs.client.core.enums.JRSVersion;import com.jaspersoft.jasperserver.jaxrs.client.core.enums.MimeType;import com.jaspersoft.jasperserver.jaxrs.client.core.operationresult.OperationResult;//code shortened... private String parametername = ""; private List<String> parameterMap = new ArrayList<String>();//code shortened... System.out.println(parameterMap.toString());//this does print out [smith, Miller, Bush]//reportPath is the URL for the report inside the jasperserver//format is e.g. PDF OperationResult<InputStream> result = session .reportingService() .report(reportPath) .prepareForRun(format.toUpperCase()) .parameter(parametername, parameterMap) .run();[/code]Does anyone have an idea where to look? Is there a way to log the resulting query string in jasperserver?Thanks in advance!Greetings, Philipp Link to comment Share on other sites More sharing options...
philippw Posted October 23, 2018 Author Share Posted October 23, 2018 Answer related tohttps://community.jaspersoft.com/questions/1108816/collection-parameter-nestedtype-integer-empty 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