Render text field with string empty

0
Hello! i'm new into world to JasperStudio.
 
I have a table where the all cells have the styled borders. Within, the "text fields" it automatically resize if necessary. 
 
One of these fields, has value string empty, by my function 
case WHEN ({field} = null) THEN ' ' ELSE {field} || ... (etc.) end
 
The problem is that the "text field" seems not rendered with string empty, although isBlankWhenNull="false",  and i have this unpleasant effect.
grid example
* Into image i have forced backgroud-color red, for let you see that "text field" is not rendered.
 
Is possible constrain the render also is string empty? 
Or there are other solutions.
Thanks in advance.
msolari's picture
Joined: Apr 22 2016 - 1:45am
Last seen: 3 years 6 months ago

Hi, Could you please explain better about your requirement?
Regards,
KKriplani

kkriplani - 3 years 7 months ago

My scope is avoid, in case of downsizing of the fields for the content, that is shown cell border, since into first two cells the value is string empty, seems the text field is not rendered

msolari - 3 years 7 months ago

3 Answers:

1

Not sure what you're trying to do but JasperReports seems to be working as you've specified. Why are you setting value to blank when null instead of isBlankWhenNull = true? I'm not sure of what you're trying to do but if you just want to have empty bordered cell, place a static text over the text box and set Print When Expression so that static text will be printed on the field is null and text field not printed when the value is null.

hozawa's picture
52642
Joined: Apr 24 2010 - 4:31pm
Last seen: 5 months 1 week ago
0
To answer your question:
Why are you setting value to blank when null instead of isBlankWhenNull = true?
 
i started with isBlankWhenNull="true", for avoid the print "null" into field, but 
i obtained the same unpleasant effect that i have now.
 
My solution is manage the value, with string empty, before to be processed by jasper. The problem seems be that the "text field" if it find "string empty", It treats him as NULL and not print the value. The background-color of text field, shows that the element it is not rendered.
 
Your idea is good, a bit it me bothers duplicate all fields for manage a value that could be print how to received.
 
Thanks hozawa
msolari's picture
Joined: Apr 22 2016 - 1:45am
Last seen: 3 years 6 months ago
0
Actually i forgot, a detail important.
The anomaly, is present only if the thext fields, of same row, they resize.
If this does not happen, everything works.
msolari's picture
Joined: Apr 22 2016 - 1:45am
Last seen: 3 years 6 months ago
Feedback