navynine Posted July 24, 2014 Share Posted July 24, 2014 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 More sharing options...
hozawa Posted July 24, 2014 Share Posted July 24, 2014 I'm not sure what the problem is here. Can't you just set "underline" in the text field properties? JasperReports will also underline the wrapped text.If the text is shorter than the page, you can just append the text value with spaces. Link to comment Share on other sites More sharing options...
navynine Posted July 24, 2014 Author Share Posted July 24, 2014 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now