christmoney1 Posted February 8, 2022 Share Posted February 8, 2022 Hello everybody, May i have your help?I would like to write a condition on jasperstudiosoft to display my phones number like that:Telephone: 339922/440011/882211/contact@emergency.comOne of these fields could be empty.for example:if the firste number (339922) is empty this 'll be displayed : Telephone: 440011/882211/contact@emergency.com if the secund number(440011) is empty this 'll be displayed: Telephone: 339922/882211/contact@emergency.comif the mail(conctact@emergency.com) and the first number(339922) are empty this'll be displayed: Telephone: 440011/882211if all the field are empty the we'll have Telephone: This is my expression to do that: ("Telephone:" + " " + "<u>"+($F{Numéro de téléphone domicile de cette personne.Individu}== null? $F{Numéro de téléphone portable de cette personne.Individu}+ "/" + $F{Numéro de téléphone pro de cette personne.Individu} + "/" +$F{Email de cette personne.Individu} : $F{Numéro de téléphone portable de cette personne.Individu} == null? $F{Numéro de téléphone domicile de cette personne.Individu} + "/" +$F{Numéro de téléphone pro de cette personne.Individu} + "/" + $F{Email de cette personne.Individu}: $F{Numéro de téléphone pro de cette personne.Individu} == null? $F{Numéro de téléphone domicile de cette personne.Individu} + "/" + $F{Numéro de téléphone portable de cette personne.Individu} + "/" + $F{Email de cette personne.Individu}:$F{Email de cette personne.Individu}== null? $F{Numéro de téléphone domicile de cette personne.Individu}+ "/" + $F{Numéro de téléphone portable de cette personne.Individu}+ "/" +$F{Numéro de téléphone pro de cette personne.Individu}: $F{Numéro de téléphone domicile de cette personne.Individu}+ "/"+ $F{Numéro de téléphone portable de cette personne.Individu} + "/" + $F{Numéro de téléphone pro de cette personne.Individu} + "/" + $F{Email de cette personne.Individu})+"</u>") But when i lunch report it don't work very well.For example if all the field are empty it display that: there is someone to help me ?Sincerely. Link to comment Share on other sites More sharing options...
bigalex Posted February 8, 2022 Share Posted February 8, 2022 Sorry, I am just guessing here what you are trying to do. (see the attached example)"Telephone: " + ($P{Part_1}!= ""? $P{Part_1}:"")+($P{Part_1}!=""? ($P{Part_2}!= ""? " / "+ $P{Part_2}:""): ($P{Part_2}!= ""? $P{Part_2}:""))+(($P{Part_1}!="" || $P{Part_2}!= "")? ($P{Part_3}!= ""? " / "+ $P{Part_3}:""):($P{Part_3}!= ""? $P{Part_3}:""))+(($P{Part_1}!= ""|| $P{Part_2}!= "" || $P{Part_3}!= "")? ($P{Email}!= ""? " / "+ $P{Email}:""):($P{Email}!= ""? $P{Email}:"")) Link to comment Share on other sites More sharing options...
christmoney1 Posted February 9, 2022 Author Share Posted February 9, 2022 Dear bigalex, mani thank for your answer but it stil don't work.See attached my jrxml.Sincerely Link to comment Share on other sites More sharing options...
bigalex Posted February 9, 2022 Share Posted February 9, 2022 Hi,Edit my Expression example and replace "Part_#" with your variables.for example: $P{Part_1} would be $F{Numéro de téléphone domicile de cette personne.Individu} 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