Issue with text wrapping in textbox

16 posts, 0 answers
  1. Raymond
    Raymond avatar
    2 posts
    Member since:
    Oct 2011

    Posted 06 Oct 2011 Link to this post

    I'm currently reviewing Telerik Reporting (version Q2 2011, 5.1.11.713) and I run into an issue with a textbox with a fixed width, but allowed to grow vertically. The calculation of the number of lines (required to wrap the given text in) fails. The text (Value) below is actually wrapped in a single-line textbox, but actually doesn't fit on one line and gets wrapped! This is obviously not what we want (see attachment).

    Properties set:

    CanGrow = True
    CanShrink = False
    KeepTogether = True
    Size = 8,91cm; 0,5cm
    Value = "Courtage conform bemiddelinsovereenkomst d.d. 1-10-2011"
    Style.Font = Verdana, 8pt, Regular
    Style.VerticalAlign = Middle

    Any help would be greatly appreciated!

    Best regards,
    Raymond

  2. IvanY
    Admin
    IvanY avatar
    417 posts

    Posted 11 Oct 2011 Link to this post

    Hello Raymond,

    Using your property settings we were not able to reproduce the issue. However, we noticed that if you set the Multiline property of the TextBox to False the text is wrapped just like in your screenshot. So if this is the case an option for you will be to set Multiline to True and after that you can choose if you want the text to wrap.

    Kind regards,

    IvanY
    the Telerik team

    Q2’11 SP1 of Telerik Reporting is available for download (see what's new). Get it today.

  3. DevCraft banner
  4. Raymond
    Raymond avatar
    2 posts
    Member since:
    Oct 2011

    Posted 12 Oct 2011 Link to this post

    Hello IvanY,

    Unfortunately setting Multiline to 'False' doesn't solve my problem. The textbox is used in a (repeated) detail view on an invoice. Changing that property to 'False' makes the textbox wrap the text correctly, but prevents my order line from resizing. This results in overlapping order lines, resulting in text still not being displayed correctly on the report.

    Best regards,
    Raymond
  5. Chavdar
    Admin
    Chavdar avatar
    898 posts

    Posted 17 Oct 2011 Link to this post

    Hello Raymond,

    From your description it seems that the problem is more complicated than we initially assumed. If the suggestions that we gave didn't work then we will appreciate if you can open a support ticket and send us a working solution which reproduces the problem. In this way we will investigate the real issue and let you know how to fix it.

    Greetings,
    Chavdar
    the Telerik team

    Q2’11 SP1 of Telerik Reporting is available for download (see what's new). Get it today.

  6. Sean
    Sean avatar
    3 posts
    Member since:
    Feb 2013

    Posted 01 Feb 2013 Link to this post

    Has there been a fix for this?

    I have a textbox,
    CanGrow = true
    KeepTogether = true
    Multiline = true
    TextWrap = true
    Size = 5.5in, 0.2in

    For a string that is just long enough to be wrapped to 2 lines on PDF export, printviewer and word export tries to stuff the sting into one line.  In doing so, it leaves a new line after the first string.  It is almost as if, it thought it needed two lines (which is correct) then decided to put all in one line, leaving an exptra space.

    This can be easily reproduced by created a textbox inside of report.  Report inside of reportviewer.  And stuff a string that is just long enough to be 2 lines.
  7. IvanY
    Admin
    IvanY avatar
    417 posts

    Posted 06 Feb 2013 Link to this post

    Hello Sean,

    We have tried testing this locally but we were unable to reproduce any issue. Therefore it will be best if you can provide us with the text you are using for this test and any other settings that we should be aware of.

    Kind regards,
    IvanY
    the Telerik team

    HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

  8. Sean
    Sean avatar
    3 posts
    Member since:
    Feb 2013

    Posted 06 Feb 2013 Link to this post

    * Designer width = 6.5 inch
    * Create a group with width = 6.5 inch
       a.  nothing in the group header
       b.  nothing in the group header
       c.  put two textboxes inside the group detail.  
          1.  text box 1 = width = 1 inch
          2.  text box 2 = width = 5.5 inch
          3.  set the properties to (CanGrow = true, KeepTogether = true, Multiline = true, TextWrap = true)
    * Use "NeedDataSource", map a data table with two columns to above textboxes (one column per textbox).
    * In the data table above, first column's text is always shorter than textbox length. (put "test" for this test).
    * In the data table above, second column's text is sometimes longer than textbox, forcing it to wrap.  a sample text for second column might be like this one.

    "The Tango telephoned Tail of Masooon T. Dondler, Quarter Houice Geranilen, with the Vick Tressleey's qarto, in Tacatoin, with a breifing."

    When  you run the report using report viewer, you will see that report viewer allocates 3 lines for the text but only uses 2, leaving extra space (line break).  This is more apparent when you export it to PDF which shows all things correctly.

    In the "NeedDataSource" function, you do not necessary have to map a data table to see this happen.
    You can simply map "test" to first text box and "The Tango telephoned Tail of Masooon T. Dondler, Quarter Houice Geranilen, with the Vick Tressleey's qarto, in Tacatoin, with a breifing." to second to see this happen.



  9. IvanY
    Admin
    IvanY avatar
    417 posts

    Posted 11 Feb 2013 Link to this post

    Hi Sean,

    You are not using the default font since the text that you have provided is long only a line and a half (this is without changing the fonts). Therefore we will need as well the font, its size and if it is bold or italic. Please also test your scenario with an empty report and your textbox in it - that way we will be able to isolate the issue and strip unneeded details such as using groups and NeedDataSource for example.

    All the best,
    IvanY
    the Telerik team

    HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

  10. Martin
    Martin avatar
    1 posts
    Member since:
    Dec 2013

    Posted 03 May Link to this post

    Hello,

    I have similar problem as this post describe.
    TextBox on my Telerik reports cuts long text on report view. On PDF export is the text OK, but it don't have the same number of rows.

    I attach two photos as a proof.

    Can you say me how to fix this problem? The report is new and have default font and text size as you advised above. Only TextBox width is bigger: 15cm.

    My Telerik reports have the same problem.

    I need same report view as PDF export or other exports.

    Most often configuration I use:
    Calibri font with 9pt size,
    CanShrink = true,
    CanGrow = true
    Multiline = true
    TextWrap = true

    All the best,
    Martin

  11. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 05 May Link to this post

    Hello Martin,

    Based on your screenshot, this is the WPF ReportViewer, where reports are rendered as XAML in order to be loaded in the viewer.

    The produced XAML consists of Canvases, TextBlock elements and others that can be affected by external style setters. Please test displaying the same report in the local WPFDemo project to eliminate custom styling as a possible source of the issue.

    In case the content is still clipped in the XAML rendering, test to change the item's Style properties like (Font.Name, Font.Size, Padding, TextAlign, VerticalAlign).

    Regards,
    Stef
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  12. Franklin
    Franklin avatar
    6 posts
    Member since:
    May 2014

    Posted 29 Sep Link to this post

    Hello,

    I am having the same problem as Martin. When exporting to PDF the truncated text is shown properly.

    Another thing I've noticed is that changing the font in the TextBox to be a Monospace or fixed-width font (Arial for example) fixes the problem.

    Is this a bug or a feature? I would like to use whatever font I wish and have the TextBox grow and wrap accordingly. I don't think that is unreasonable.

    Thanks,

    Franklin

  13. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 30 Sep Link to this post

    Hi Franklin,

    For thw WPF and Silverlight ReportViewer, we use XAML rendering - the report is turned into XAML loaded by the viewer.

    In this case it is possible to have issues how fonts are measured and interpreted in XAML (WPF technology related). We use GDI methods to measure elements based on their settings and content, based on the applied styles. We logged a task to research the issue. The workarounds are to change the TextBox Style (alignment, font, font size, etc.) to produce a layout without clipped content.


    On a side note, external style setters can mess with the XAML in the viewer (TextBlock, Canvas elements and else). Please test excluding any additional styles in the project,

    Regards,
    Stef
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  14. Franklin
    Franklin avatar
    6 posts
    Member since:
    May 2014

    Posted 30 Sep in reply to Stef Link to this post

    Stef,

    Thanks for your reply. I ensured that there were no styles being applied to the TextBox in my report viewer window in WPF. I have attached three screen shots. One with the Trade Gothic font I wish to use, one with Arial, and one with Times New Roman. The Trade Gothic is the only one which shows truncated text. I can send you the font as well but not sure I can attach it to this reply.

    I'm using Reporting Q1 2015.

    Thanks,

    Franklin

  15. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 30 Sep Link to this post

    Hello Franklin,

    Forums are limited to image attachments, code snippets and text descriptions. You need to use a support ticket to submit ZIP files.
    Another community member reported that using text formatting Ideal resolved a similar issue in his WPF application - WPF 4.0 Text Stack Improvements. Please give it a try and let us know the result.

    Regards,
    Stef
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  16. Franklin
    Franklin avatar
    6 posts
    Member since:
    May 2014

    Posted 30 Sep in reply to Stef Link to this post

    Stef,

    Thanks again for your reply. I tried assigning a style to both TextBox and TextBlock in my report viewer window XAML and tried assigning values of both Ideal and Display. No change when using the problem font. I do want to try and use the same font throughout our application if possible.

    Thanks,

    Franklin

  17. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 04 Oct Link to this post

    Hello Franklin,

    The attached demo project uses a free alternative of  Trade Gothic font. Please test updating the report to use your font and test previewing the content in the WPF ReportViewer.
    The project uses Telerik Reporting R3 2016 and the corresponding Telerik UI for WPF version. Fonts are loaded without being installed as private fonts.

    We will need to know what changes to be applied on the Textbox items and what content to be loaded in order to reproduce the problem.

    Regards,
    Stef
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner