jburczyk Posted October 10, 2019 Share Posted October 10, 2019 I'm working on a report, and I have several parameters that are Multi-Select type parameters that are set up as $X{IN,column_name,parameter_name}, but in my testing when I select a value for the parameter, I'm also getting rows where column_name is null. Is there a way to exclude those values IF the parameter is not empty? Link to comment Share on other sites More sharing options...
danoldenkampgmail.com Posted October 10, 2019 Share Posted October 10, 2019 IF I am understanding you,If you don't have any values selected then the query returns as if null. I was able to recreate this.To make the element (let's say a table) not visible if the parameter is null or not set,Set the table's advanced propertey of print when visible to only display if the parameter has value.I was able to evaluate the expression correctly by checking if empty:$P{Parameter1}.isEmpty().toString()=="false" This effectively only displays the table element if the parameter is not empty. Link to comment Share on other sites More sharing options...
C-Box Posted October 11, 2019 Share Posted October 11, 2019 Why not just:!$P{Parameter1}.isEmpty()[/code]the PrintWhenExpression just needs a boolean value, as isEmpty() already returns true/false there is actually no need to convert it to a String and compare the 'false' string value.Just my two cents. regards C-Box Link to comment Share on other sites More sharing options...
danoldenkampgmail.com Posted October 11, 2019 Share Posted October 11, 2019 Thanks that's much cleaner. Link to comment Share on other sites More sharing options...
jburczyk Posted October 11, 2019 Author Share Posted October 11, 2019 Thank you both for your suggestions. The issue that I'm having is that when I select values for the parameter, I'm getting those values in the report + the null values, and I only want those values, not the nulls. Perhaps I just don't have my parameter set up properly. 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