Jump to content
We've recently updated our Privacy Statement, available here ×

Text Field Number Format


2004 IR Help

Recommended Posts

By: Chris - cjsturgess

Text Field Number Format

2005-07-11 07:22

Hey all,

In my reports, if the number value is 0, I would like to display a dash (-) instead of 0 or 0.0. I saw in the tips and tricks section that you can overlay two text boxes, displaying one text box (the dash) when the value is 0, and the other in any other case. I've tried this and it's very unwieldy when dealing with 70 or so text boxes.

Is there a way to dynamically change the value class for a text field? What number formatter does JasperReports use? Is it the Number Format java class? Is there something similar to Excel where you can enter a pattern for a zero value as well as positive and negative values?

I've looked at extending the source code, but I can't find where the pattern is actually applied to the text. If I can make my own custom number formatter, it would make my life a whole lot easier. Thanks for any help in advance.

 

- Chris

 

 

 

 

By: C-Box - c-box

RE: Text Field Number Format

2005-07-11 07:38

look here... it's quite the same question isn't it? :-)

 

https://sourceforge.net/forum/message.php?msg_id=3241236

 

hth

C-Box

 

 

 

 

By: Chris - cjsturgess

RE: Text Field Number Format

2005-07-11 07:46

Thanks C-Box, that will work perfectly.

Link to comment
Share on other sites

  • 4 years later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

 

Sorry to resucitate an old thread but the suggested link does not work. I am wondering how did you resolve this issue? Excel formatting allows for more options than Jasper as far as I can tell.

Thanks in advance,

-Nestor

Link to comment
Share on other sites

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...