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

Hiding HtmlTextBox makes PDF blank

1 Answer 99 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mercell
Top achievements
Rank 2
Mercell asked on 22 Apr 2009, 07:38 AM
Hi,

I have a report with some HtmlTextBox'es that I hide if they contain no data. This works fine in the ReportViewer and when exporting to Excel and RTF but when exporting to PDF I just get a blank page.

This is the code I use for hiding the textbox and the corresponding label:

internal static void HideEmptyHtmlTextBox(HtmlTextBox htmlTextBox, Telerik.Reporting.TextBox labelTextBox)  
{  
    if (htmlTextBox.Value == null || ((string)htmlTextBox.Value).Trim() == "")  
    {  
        htmlTextBox.Visible = false;  
    }  
 
    if (!htmlTextBox.Visible && labelTextBox != null)  
    {  
        Telerik.Reporting.Processing.ReportItemBase itemBase = ((Telerik.Reporting.Processing.ReportItemBase)htmlTextBox.Parent);  
        Telerik.Reporting.Processing.TextBox label = (Telerik.Reporting.Processing.TextBox)itemBase.Items[labelTextBox.Name];  
        label.Visible = false;  
    }  
}  
 

If I use a normal TextBox instead it all works fine!

Another problem is that "bold" and "italic" text isn't shown as bold and italic in the pdf just as normal unformatted text?!

What's wrong and how do I solve this?

Thanks,
Brian

1 Answer, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 22 Apr 2009, 08:22 AM
Hello Bo,

This is a known issue that has already been addressed and would be part of the SP1 expected by the end of this or beginning of next month. For the time being, you can set a minimal height for the HtmlTextBox, so that it would grow whenever there is content. Then when you want to hide it, set its Value as empty string and this way it would not grow i.e. would not occupy any space, just like it was set to visible=false.

Please excuse us for the inconvenience.

All the best,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Mercell
Top achievements
Rank 2
Answers by
Steve
Telerik team
Share this question
or