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

Underline text if it's not fit in one line


navynine

Recommended Posts

Hello,

Could someone help me with question about making text that can be splitted to several lines underscored?

I have a text field that is filled by user's data, so it can be bigger than page's width, therefore text will be splitted for two (or more) lines. I need to draw a line under this text (to show that it's entered by a user); this line should be drawn under each line of text and should has page's width. Also this line should be always drawn on the first line and shouldn't be printed on next lines if there is no text.

 

I.e.

Describe issue: here is quite long describing of problem that is splitted for  

two or more lines                                                                                                   

Or 

Describe issue: here is short describing of problem                                         

 

I tried to define 'print when expression' but don't know how to get actual length of entered text (I'm using not monospaced font) or how to determine that text line was broken.

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

I can add spaces, but how much? Because actual width of one char differs from another char's width (e.g. 'I' and 'w') I can't calculate it.

In Java I can get font's metrics and calculate total width of phrase, but I can't get such metrics in iReport

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