johann60280 Posted May 31, 2017 Share Posted May 31, 2017 Hello everybody!! I have a problem on Ireport. I try to display a line from a result of subreport. So I have a subreport who contains some result (or not). I use a parameter in this subreport who called "Return values". I affect this parameter in a variable called "affiche". So this variable contains "1" if there is one result in the subreport or "0" if there is nany result. So I try to hide a line who are next to the subreport if my variable contain "0".This is my condition in line (on a parameter "Print When Expression"):$V{affiche} != "0" ? Boolean.TRUE : Boolean.FALSE But unfortunately it doesn't work. I put an image to show mu problem. I hope my case is clear but if you want more explanation I will can give you. Thank you to help me :) Link to comment Share on other sites More sharing options...
szaharia Posted May 31, 2017 Share Posted May 31, 2017 If your variable is of type java.lang.String, use!$V{affiche}.equals("0")as print when expression.If your variable is of type java.lang.Integer, use$V{affiche} != 0 Link to comment Share on other sites More sharing options...
johann60280 Posted June 1, 2017 Author Share Posted June 1, 2017 Oh thank you for your help!! Yes it work but not completely..Indeed my variable is of type java.lang.integer. I use what you give me with a modification:$V{affiche}.intValue() != 0 ?Boolean.TRUE: Boolean.FALSEBut the line is misssing when my variable return not 0. Can you tell me why ? 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