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

Report TextBox Height error/bug

7 Answers 191 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
imad
Top achievements
Rank 1
imad asked on 13 Dec 2010, 03:41 PM
Hello,

In a asp.net application, I have a simple report, with 2 textbox in the detail section, the first one contain the name of the item and the second one will display the HTML resulting from and XSLT transformation (i am assigning by code the value on ItemDataBound).

On preview the first textbox render fine, but the second has a height of 450px and the real content has a height of 200px.

Is this a bug or i am missing something here?

Thank You

7 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 14 Dec 2010, 09:19 AM
Hi imad,

The height is determined at runtime based on the content of the item, moreover the TextBox item can grow only vertically.
Additionally if you check the Using Report Item Events help article, you would notice that the ItemDataBound event fires just after the item is bound to data i.e. it is too late to set the value in that event, instead you should use the ItemDataBinding event.

Regards,
Steve
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
0
imad
Top achievements
Rank 1
answered on 14 Dec 2010, 03:49 PM
Thank you for you reply,

I managed to fix the height issue before shifting the code to ItemDataBinding event, but now i am keeping the textbox assigning in ItemDataBinding.

Now i am facing another problem with HTML page sizing, even the settings are set to A4 but it only get displayed in one long page and when i print it i have one page truncated (I am overriding the print of reportviewer to use the browser print).

what should i do in order to have the report shown on multiple pages?
0
Steve
Telerik team
answered on 16 Dec 2010, 10:47 AM
Hello imad,

Generally speaking all supported rendering extensions have their own limitations and peculiarities which are outlined in the Design Considerations for Report Rendering help section. Specifically the difference between HTML and Image (used for printing) is bigger as the first one has no concept for physical pages and creates "logical" pages only, while the Image rendering is responsible for fully blown page oriented formats such as PDF. You can refer to the above section for more info and explanation of both.
In short, report rendered in HTML (web viewer) would always differ from page oriented formats (PDF, RTF etc.)

Greetings,
Steve
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
0
imad
Top achievements
Rank 1
answered on 20 Dec 2010, 08:42 PM
Thank you for your reply,

But i am stuck and don't know what to do, I need the full HTML support as i am displaying the result of a XSLT transformation from a XML source and I also need the paging capabilities as i need to print header and footers and insert page break after some sections.

I tried the silverlight viewer it resolves the paging issue but don't render the HTML, although the telerik for silverlight controls have a control for full html rendering. 

I need any solution that allow my end users to print full HTML with paging support.

Please help or give me some direction.
0
Steve
Telerik team
answered on 22 Dec 2010, 10:33 AM
Hello imad,

It seems there is some misunderstanding. Once again the page oriented printing has nothing to do with non page oriented format such as HTML. The printed report would still print properly even though it would look and be paged differently when shown in the web report viewer. As you have found out, the report is properly paged in the Silverlight viewer which uses the XPS rendering and the print from the Silverlight viewer prints correctly as well, so this is your solution.

All the best,
Steve
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
0
imad
Top achievements
Rank 1
answered on 22 Dec 2010, 10:59 AM
Thanks For your reply,

Ok the silverlight viewer will solve the paging issue but not rendering a full HTML format.
To overcome this limitation i replaced the texbox with picturebox and on itemdatabinding event i am converting the HTML to an image and assign to the report picturebox

Telerik.Reporting.Processing.PictureBox pict = sender as Telerik.Reporting.Processing.PictureBox;
MemoryStream str = new MemoryStream();
            HTMLShot.GetHTMLShot(System.Web.HttpContext.Current.Request, htmlString, str, System.Drawing.Imaging.ImageFormat.Png, null, null);
            Image img = Image.FromStream(str);
            img = ImgTrimWhiteSpace.CropImage(img);
            pict.Image = img;

            pict.Width = new Unit(img.Width, UnitType.Pixel);
            pict.Height = new Unit(img.Height, UnitType.Pixel);

In webreportviewer i am able to see the images, but in silverlight reportviewer i get a blank page, same thing when i try to export to pdf.

How to resolve this issue as this is my last resort.

Thank you for your help.
0
Steve
Telerik team
answered on 29 Dec 2010, 04:35 PM
Hi imad,

The Telerik Reporting WCF Service enables the remote access to the Telerik Reporting Engine and acts as a communication interface between the client programs and the report server. As any standard WCF service, it has 2 endpoints - one for the data and one for the resources. Images are resources, so they are streamed through the resource endpoint - please see the following help article for sample configuration: Hosting WCF Service in IIS. If images are missing in the report in Silverlight viewer, most likely the WCF service is not configured properly, specifically the resource endpoint, so review the referenced threads carefully. To make sure this is not a configuration problem, you can place your report in our Silverlight demo app we provide and run it directly there. You can then compare the configuration and update your project accordingly.

Regards,
Steve
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
Tags
General Discussions
Asked by
imad
Top achievements
Rank 1
Answers by
Steve
Telerik team
imad
Top achievements
Rank 1
Share this question
or