Jump to content
Changes to the Jaspersoft community edition download ×

"n/a" versus "null"

2004 IR Help

Recommended Posts

By: deklotz - yourspeedracer

"n/a" versus "null"

2005-06-09 11:50

Is there an easy way to have "n/a" fill a cell instead of the default "null" when the data object is null?


I personally do not like the option of "isBlankWhenNull="true". It just doesn't look right to me.


If possible I want to avoid using something like :


(($F{COLUMN_13} == null) ? "n/a" : $F{COLUMN_13})


as this means I lose the built in number formating (for when there is a real number present).


Any help is greater appreciated.









By: C-Box - c-box

RE: "n/a" versus "null"

2005-06-09 23:20

Well, as there is an attribute "BlankWhenNull" you could easily change the piece of source in JasperReportsSourceCode where the blank-string is replaced against the null-value.... so there you could put "n/a" instead of "" .... but you should do that modification everytime you update to a new JasperReports-Version.


Perhaps you can make a FeatureRequest, where you could suggest to introduce a "ReplaceStringWhenNullValue" Variable where everyone can print what he want's if a field returns null.


Otherwise the only solution I know is the if-then-else statement you also posted but don't want.








By: kootjekip - kootjekip

RE: "n/a" versus "null"

2005-06-10 04:37

I dislike some things to but it is there so I try to live with it, because someone dislikes something, it's not needed to rewrite the application for thousands of users.





By: Mike Warne - mwarne

RE: "n/a" versus "null"

2005-06-16 18:12

If the formatting is the big issue, create a variable that is a NumberFormat or NumberFormatter instance.

Then use that Variable to format your number. I have done this with Dates sometimes using SimpleDateFormat


$F{Col2} == null?

"Not Available":




Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...