Jump to content
Changes to the Jaspersoft community edition download ×

Proper line spacing approach

Recommended Posts

By: Richard S. Hall - rickhall

Proper line spacing approach

2002-08-09 11:19

I just started to evaluate JasperReports via JasperEdit and I like what I see. One issue I am not sure about though, is line spacing. The line spacing for example reports that come with JasperEdit is huge. It appears that they just set the of the report element to "20".


This seems somewhat shoddy. What is the proper way to define the report element height with respect to the font size? Is there no automatic way to do this? If not, does that mean if I change the font size I have to change the height for all of my fields manually?


Thanks in advance.


-> richard



By: Teodor Danciu - teodord

RE: Proper line spacing approach

2002-08-12 01:30




There is a text field attribute

called "stretchWithOverflow".


If set to true, the text field will stretch downwards

in order to acquire all its content according to the

font size, no matter what it is its initial height

(even zero).


This is probably the most flexible setting you will

want to have.

But if you decide to not allow the text fields to

stretch, for any reason, then it is for you to decide

how much space you will allow them to use (height).

This way it is for you to calculate what is the

desired height according with the current font size.


The design viewers can help you a little, because if

you set the text field height too small, the text field

expression will disappear, thus giving you an idea

about what is the minimum height for the text field

to display at least some number of lines using the

current font.


Check the samples supplied with JasperReports.

They are a little more complex, especially the one

called "jasper".

You can preview them on the spot going to the

desired sample directory and launching the "ant

viewDesignXML" command.


I hope this helps.


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