gardnerw
-
Posts
5 -
Joined
-
Last visited
Content Type
Forum
Downloads
Featured Visualizations
Knowledge Base
Documentation (PDF Downloads)
Blog
Documentation (Test Area)
Documentation
Dr. Jaspersoft Webinar Series
Security Advisories
Events
Profiles
Posts posted by gardnerw
-
-
:) Defo worth the extra karma points for taking the time and patience.
Thanks Slow!
-
Sorry i get it, i'm being dopey!
($F{field_1}!=null?$F{field_1}:"")+($F{field_2}!=null?", "+$F{field_2}:"")+...($F{field_8}!=null?", "+$F{field_8}:"")
Thanks for your help again slow!
-
Thanks Slow,
I am still having a bit of a problem, if I insert a break between each field ($F{field_1}!=null?$F{field_1}:"")+($F{field_2}!=null? ", ":$F{field_2})
so when there is more than one field it grows. IE: field 1, field 2, field 3, field 4 etc but when there is just one it reads field 1. I get "," when the field is null and have "null" appearing again.
Many Thanks for your help,
-
How would i extend this to consider 8 fields any number of which could be filled?
Many Thanks
Will
Concatenating 2 fields, one of them null
in Products
Posted
Hi,
I hope it is OK bringing this old post back to life!
I wanting to format a report to present data prefixed with text if the field was filled in the db but not if left null.
I am using the following code
(($F{old_tag1}!=null?"Tag Number: "+$F{old_tag1}+". ":"")+($F{tpo}!=null?" TPO Number: "+$F{tpo}+". ":" ")+
($F{height}!=null?"Height(m): "+$F{height} + ". ":"")+($F{spread}!=null?"Spread: "+$F{spread} +"m. ":"")+($F{distance_road}!=null?"Distance Nearest Structure: "+$F{distance_road} + "m. ":"")+
($F{dbh}!=null?"DBH(cm): "+$F{dbh}:"")+($F{dbh_2}!=null?", "+$F{dbh_2}:"")+($F{dbh_3}!=null?", "+$F{dbh_3}:"")+($F{dbh_4}!=null?", "+$F{dbh_4}+". ":"")+
($F{number_of_stems}!=null?"Number of Stems: "+$F{number_of_stems} + ". ":"")+($F{age_class_description}!=null?" Life Stage: "+$F{age_class_description}+ ". ":"")+($F{vitality_description}!=null?"Vitality: "+$F{vitality_description}+ ". ":"")+
($F{park_value_description}!=null?"Physiological Condition: "+$F{stability_description}+". ":"")+($F{stability_description}!=null?"Structural Condition: "+$F{stability_description}+". ":"")+
($F{longevity_description}!=null?"Useful life expectancy(years): "+$F{longevity_description}+". ":"")+($F{longevity_after_description}!=null?"Useful life expectancy after work (years): "+$F{longevity_after_description}+". ":"")+($F{note}!=null?"Surveyors Comments: "+$F{note}+". ":""))
It works great if all fields are filled but if i dont fill old_tag1 for example i get the text "Tag Number:" +", ".
Any help would be gratefully recieved!