Issue with text wrapping in textbox

1 Answer 8289 Views
General Discussions
Raymond
Top achievements
Rank 1
Raymond asked on 06 Oct 2011, 11:33 AM

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

1 Answer, 1 is accepted

Sort by
0
IvanY
Telerik team
answered on 11 Oct 2011, 02:51 PM
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.

Raymond
Top achievements
Rank 1
commented on 12 Oct 2011, 08:42 AM

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
Chavdar
Telerik team
commented on 17 Oct 2011, 08:52 AM

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.

Sean
Top achievements
Rank 1
commented on 01 Feb 2013, 07:34 PM

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.
IvanY
Telerik team
commented on 06 Feb 2013, 01:31 PM

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!

Sean
Top achievements
Rank 1
commented on 06 Feb 2013, 01:55 PM

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



IvanY
Telerik team
commented on 11 Feb 2013, 11:56 AM

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!

Martin
Top achievements
Rank 1
commented on 03 May 2016, 12:16 PM

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

Stef
Telerik team
commented on 05 May 2016, 12:16 PM

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
Franklin
Top achievements
Rank 1
commented on 29 Sep 2016, 07:20 PM

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

Stef
Telerik team
commented on 30 Sep 2016, 11:42 AM

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
Franklin
Top achievements
Rank 1
commented on 30 Sep 2016, 01:26 PM

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

Stef
Telerik team
commented on 30 Sep 2016, 04:25 PM

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
Franklin
Top achievements
Rank 1
commented on 30 Sep 2016, 05:15 PM

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

Stef
Telerik team
commented on 04 Oct 2016, 03:16 PM

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
Deepak
Top achievements
Rank 1
commented on 27 Mar 2020, 09:03 AM

Hi Admin,

I'm currently using Telerik Reporting designer(Version: 11.1.17.503) for creating the report.  In my report the columns are dynamically produced according to the inputs. So when the columns are more the Parameters section toolbar is getting an alignment issue as it is going beyond the visible part of the screen.

I'm attaching 3 screenshots below.

 

In the First screen shot, I'm creating the Crosstab as same size as the Parameter section toolbar, so it is coming correctly.

In the Second screenshot, I reduced the column width of Crosstab and make it left then the right side parameters are misaligned.

In the third screenshot I reduced the Crosstab column width and make it center, then also the right side parameters are getting misaligned.

I tried many properties but not getting anything. 

So please give me a solution for this issue.

 

Thank You.

Tags
General Discussions
Asked by
Raymond
Top achievements
Rank 1
Answers by
IvanY
Telerik team
Share this question
or