Jump to content
  • Unwanted wordwrap on single line textfield


    condor70
    CategoryFeature request
    PriorityLow
    ReproducibilityRandom
    ResolutionReopened
    SeverityTrivial
    StatusClosed

    This topic comes up several times in the forum, but nobody seems to have made a feature request for it:

     

    Quote:

     

    Word wrapping in text fields is turned on by default and there is no way of turning it off. It is not so much of a problem if your textfield is supposed to grow (then you usually WANT it to be nicely wrapped), but if you need a text field to stay fixed height, and display as much text as possible in a line, then you wind up with half of your text eaten by the wrapping mechanism.

     

    (http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=&func=view&catid=8&id=19216#19216)

     

    See also "Hyphenation in TextFields" (http://jasperforge.org/sf/go/artf1397?nav=1) for a related issue.



    User Feedback

    Recommended Comments

     

    Hi,

     

    If you want the text to go to the left as far as it can, why don\'t you put a very long text field? Maybe as wide as the page width itself?

     

    Or do you expect that when the text expands it should push the other elements found at the right?

    If you do expect this, then what do you want us to do with the elements that go outside the page width because they were pushed? What kind of page break should we introduce?

     

    Note that JasperReports was created with printing in mind and the concept of page is built-into the engine.

     

    Please describe in detail the complete behavior you expect from such a feature as even though it came up many times on the forums, nobody was able to fully describe how the engine should work in such cases.

     

    Thank you,

    Teodor

     

    Link to comment
    Share on other sites

    I\'m trying to create a table-like report where every cell has the same width and height (so no stretching).

    My text fields are as wide as the surrounding table cell, but I can\'t make them any wider, because that would make large texts overflow in the cell to the right.

     

    So, I don\'t expect any stretching or page-breaks, just that (optionally) all the available field width is used to display as much as possible of the text and clip the remaining text.

     

    ps. Horizontal stretch-to-fit would also be a nice option, but that is not directly related to this request.

    Link to comment
    Share on other sites

     

    Hi,

     

    So we are actually talking about the last word that would partially fit into the declared text field width. You prefer see it partially displayed instead of being removed completely.

     

    Should this be applicable also for fixed height multi-line text fields where the last word on the last row now disappears?

     

    Thanks,

    Teodor

     

    Link to comment
    Share on other sites

    I hadn\'t thought about multi-line text fields yet (I only use them in combination with stretching), but I don\'t see why not...

     

    ps. This option should also be added to static texts, because the text could fit at design time, but not when redered with the actual font measurements.

     

    (This is relevant for me, because my reports are designed on Windows, but generated by a headless IBM iSeries/5)

     

    Link to comment
    Share on other sites

    You started me thinking about multi-line text fields and actually I would expect a different behaviour:

     

    With wordwrap disabled no line should be wrapped and only the newline characters embedded in the text should be used. If any single line in the text is too long it should be clipped.

    Link to comment
    Share on other sites

    Hi,

     

    This is implemented with the exception of your last comment, which is another story, about custom line breaking and not text field truncation.

    You can try JR 2.0.3.

     

    Thank you,

    Teodor

     

     

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