danielsl9.dp Posted October 15, 2021 Share Posted October 15, 2021 I'm having problems with some reports that use the IN clause in their query. For that I had to use $ X and define a list of values within a field as follows:<parameter name="instatus" class="java.util.ArrayList"><br> <defaultValueExpression><![CDATA[Arrays.asList(new Integer[] {5000,5022, 5036})]]></defaultValueExpression><br> </parameter>[/code]EDIT: Don't know how to delete that block lol, had to put it here-------------------------------------------------- XML --------------------------------------------------<parameter name="instatus" class="java.util.ArrayList"> <defaultValueExpression><![CDATA[Arrays.asList(new Integer[] {5000,5022, 5036})]]></defaultValueExpression> </parameter>-------------------------------------------------- XML --------------------------------------------------The report works perfect within Jasper Studio, but at the moment of publishing it to the server and executing it, I notice that the values are not loading.Jasper Studio:Jasper Report Server:Can anyone help me please. Link to comment Share on other sites More sharing options...
gustavofarias Posted October 15, 2021 Share Posted October 15, 2021 When you publish to JasperServer it probably created a local input parameter that points to an empty list.One of the many elements you can create in jasper server is lists of values. After you create one, change the input parameter of your report to link to the newly created list and you will see values in the "disponibles" tab.In this case, the list will have fixed values. Not sure if that's what you want.If you want a free to type list, change the input parameter to String. Make sure you filter it properly (e.g only numbers and commas are accepted) to avoid hacks an use this in your SQL:and column in ( $P!{singleStringOfCommaSeparatedValues} )You can create in Server your custom input parameter that you be checked against a regex. You can define it to have the format "param, param, param..." Link to comment Share on other sites More sharing options...
danielsl9.dp Posted October 15, 2021 Author Share Posted October 15, 2021 Hi Gustavo,I saw what you say, and what I did is to select that parameter and define those values. Now I can see it under that Tab. But my goal is that the report use by default those values (all) withouth selecting manually, like a normal in clause ( WHERE STATUS IN(5000,5022,5036) .. ) Link to comment Share on other sites More sharing options...
sudeep.duvvuru Posted October 19, 2021 Share Posted October 19, 2021 Create an input control with same parameter id in Server and Choose that through report properties. 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