Report TextBox Height error/bug

8 posts, 0 answers
  1. imad
    imad avatar
    19 posts
    Member since:
    Mar 2007

    Posted 13 Dec 2010 Link to this post

    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
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 14 Dec 2010 Link to this post

    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.
  3. DevCraft banner
  4. imad
    imad avatar
    19 posts
    Member since:
    Mar 2007

    Posted 14 Dec 2010 Link to this post

    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?
  5. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 16 Dec 2010 Link to this post

    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.
  6. imad
    imad avatar
    19 posts
    Member since:
    Mar 2007

    Posted 20 Dec 2010 Link to this post

    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.
  7. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 22 Dec 2010 Link to this post

    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.
  8. imad
    imad avatar
    19 posts
    Member since:
    Mar 2007

    Posted 22 Dec 2010 Link to this post

    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.
  9. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 29 Dec 2010 Link to this post

    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.
Back to Top
DevCraft banner