Jump to content
Changes to the Jaspersoft community edition download ×

Horizontal text field alignments


Recommended Posts



I have a question concerning layouts. Consider the following text field expression:


"Total: "+$F{MB}+"MB used"


If the value of MB is a number then it will be output using toString(). But this behaviour is not ideal because the field looks better formatted, which can be done using the Pattern facility on a text field.


However this means I need to create three text fields:


"Total: "

$F{MB} (with a pattern set}

"MB used"


and place all three text fields beside each other. And this is where I have a problem. The output looks unprofessional if the text isn't perfectly aligned (horizontally), and given the value of $F{MB} is entirely variable, the gap between the fields can not be pre-determined.


Is there a facility to make text fields sit beside each other and automtically increase/decrease in width, ensuring all fields are kept close to each other?






Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic





is what I do for currency...



you will probably want NumberFormat.getInstance()




"Total: "+NumberFormat.getInstance().format($F{MB})+" MB used"

Post edited by: momzilla, at: 2008/01/03 16:45

Link to comment
Share on other sites



I'm taking the "X "+NumberFormat...+" Y" route but it's kind of annoying given I thought there were some internal date/number formatting features driven from parameters (REPORT_TIME_ZONE, for example). Surely what I'm asking for is a really sensible idea? Could this be added to the wish list of features? It seems increasibly obvious for anyone wishing to mix dates/numbers & text.






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