Jump to content
We've recently updated our Privacy Statement, available here ×

IN values are not being published on the server


danielsl9.dp

Recommended Posts

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_studio_in.png.6b96808afd4651351ffc45d6c6392807.png

Jasper Report Server:

jasper_server_in.png.17fcab4514c41eb6b2f60e1376172a9a.png

Can anyone help me please.

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

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

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

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