This is a migrated thread and some comments may be shown as answers.

large text bug.

2 Answers 123 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Hicham
Top achievements
Rank 1
Hicham asked on 29 Jun 2011, 11:23 PM
Hi I have a quite simple report with 3 panels each panel has two textboxes: a title texbox with a static small text and a data bound text box that will receive a relatively large text at runtime: almost half a page of text.
Each panel is configured with KeepTogether so that the title is kept on the same page as the text.
All the three panels are in the detail section. they are packed vertically and take almost all the report width.
the report is bound to a list with just one object. So I only have a report with one detail section containing three block of texts.

When rendering in Silverlight viewer, the text overlaps.
When rendering in the pdf the text is truncated.
In both rendering, the computed size of the textbox does not seem enough to hold all the text.

Do you have any documentation, samples with large text? what the rendering engine is supposed to do.
Is there any flag to tell the rendering engine to allow breaking a textbox in the middle instead of having a large blanc space on the previous page?

Any help is welcomed.
Thank you.

2 Answers, 1 is accepted

Sort by
0
Hicham
Top achievements
Rank 1
answered on 03 Jul 2011, 02:27 PM
As a workaround to my problem. i tried to bind to a list of paragraphs without success. So I finished adding dynamically textblocs to the detail section and I still have the problem. now I'm almost sure there is an issue with the detail section when it spans more then a page. If you want to check it just add a default empty report.
Add an ItemDataBinding event handler for the report and write the following:
private void Report3_ItemDataBinding(object sender, EventArgs e)
{
    string Paragraph = "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890";
    for (int i = 0; i != 50; i++)
    {
        var tb = new Telerik.Reporting.TextBox();
        tb.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(14, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.5, Telerik.Reporting.Drawing.UnitType.Cm));
        tb.Value = Paragraph;
        tb.Dock = DockStyle.Top;
        this.detail.Items.Add(tb);
    }
}

take a look to the preview and check the begining of each page. You see the problem?
I think it's related to the layout of controls that do not handle the fact that the whole control is rendered on a different page. it just takes into account the fraction of the control that goes beyond the limit of the previous page.

So my problem remains unsolved how to add large texts to a report?! Is there a way to interact with the rendering engine?
Please Help!
0
Peter
Telerik team
answered on 04 Jul 2011, 03:51 PM
Hello Hicham,

We have examined the project you have send us through the support system and noticed that you're using \r for a new line character while we are only able to handle line feed \n and \r\n as a new line character. This leads to an incorrect measurements and overlapping.
Silverlight on the other side is using carriage return \r and \r\n for a new line characters. That's why I am suggesting you to use \r\n instead of \r. If you can't replace the new line characters in your datasource our suggestion is to utilize an user function for replacing the new line characters as the following one:

public static object ReplaceLineCharacters(string value)
{
    return value.Replace("\r", "\r\n");
}

Additionally you have left the report items' KeepTogether property to its default value True and if the report item (Textbox) can't fit on the current page the report engine tries to render it on the next page so a Page Break occur. Thus our suggestion is to set the large TextBoxes.KeepTogether to False.

Best wishes,
Peter
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Hicham
Top achievements
Rank 1
Answers by
Hicham
Top achievements
Rank 1
Peter
Telerik team
Share this question
or