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

Sizing Issue with HTML in TextBox

5 Answers 179 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stephen McDaniel
Top achievements
Rank 1
Stephen McDaniel asked on 03 Apr 2009, 01:12 AM
I need to include hyperlinks in my reports when they are rendered in the Web Viewer.  I'm currently using Q3 2008 and everything works fine.  I set the text of the textbox to include HTML like <a href="google.com">Click Me</a>.

I'm in the process of upgrading to Q1 2009, but it looks like my approach doesn't work anymore.  It seems the size of the textbox gets calculated based on the size of the text (including all the HTML code) so the textbox gets really large (even though when the browser processes the text, it's considerably smaller). 

So if I have a textbox who's Text is set to <a href="http://AReallyReallyReallyReallyReallyReallyLongLink.com">Q</a>, the textbox takes up a huge area but it ends up being only 1 characeter.

I thought I might be able to use the HtmlTextBox but it seems to completly ignore (and remove) hyperlinks.

Any suggestions?

Thanks,
-Stephen

5 Answers, 1 is accepted

Sort by
0
Svetoslav
Telerik team
answered on 06 Apr 2009, 04:45 PM
Hello Stephen,

Telerik Reporting supports a limited set of HTML elements starting with the latest version - 2009 Q1. For more information, please review the information on the new HtmlTextBox item.

In the previous versions we didn't support HTML in any way. There are certain cases when we know that using HTML inside the TextBox items would work, but we have never encouraged such usage as rendering links is a side effect of previewing the report in the Web ReportViewer - it actually runs inside a web browser (Internet Explorer, FireFox, etc.) and it is the browser that actually renders the HTML content. The other formats (PDF, XLS, RTF, etc.) would not render the HTML correctly.

As to the reason why your case worked, and now it doesn't: starting with 2008 Q3 version we have made a series of changes that have reflected over all rendering extensions including the HTML in order to improve the rendering quality. As a result we don't rely on the browser to layout the report items anymore, meaning that HTML content will not be rendered if you use HTML tags in places where it is not expected.
 

All the best,
Svetoslav
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Stephen McDaniel
Top achievements
Rank 1
answered on 06 Apr 2009, 05:27 PM
I know HTML is only supported for all formats in the HtmlTextBox.  But my requirements is for more interactive reports (with hyperlinks, etc.) when viewing it in a browser, but when it's exported or printed, I just want the data.  I followed an approach similar to the one you suggest in the KB article Handle html in reports when you’re in the context of a web page only .

I need to continue to support a rich, HTML heavy experience in my reports when viewed in the browser.  Is there any way that I can include my own custom HTML in reports (assuming it only needs to work in the Web Viewer)?  I understand you changed a lot about how report items are rendered, but unfortunately in this case, you've removed some of the power I previously relied on.  I can't even begin to think about upgrading unless there is some other work around. 

I notice the Telerik.Reporting.Processing.ProcessingItem.MeasureItem(...) method is called after ItemDataBinding event.  Would it be possible to have an additional event that is raised after MeasureItem so I can adjust the text after it's been measured?  I would be open to any other possible solution you can come up with, but this is critical functionality for me.

Thanks,
-Stephen
0
Steve
Telerik team
answered on 07 Apr 2009, 08:18 AM
Hi Stephen,

As my colleague stated, we have never encouraged the usage of hacks and that is the reason the KB article you referenced is not visible by default in the KB section. Nevertheless I understand your point and believe that setting the CanGrow property of textbox to false would work for the case you describe i.e. "So if I have a textbox who's Text is set to <a href="http://AReallyReallyReallyReallyReallyReallyLongLink.com">Q</a>, the textbox takes up a huge area but it ends up being only 1 characeter."
Exposing an additional event is not something we want to do, as it is not the solution we're looking for.

Thank you for the understanding.

Greetings,
Steve
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Manny
Top achievements
Rank 1
answered on 12 Aug 2009, 10:13 PM
Would your pejorative term "hack" include the fact that v701 2009 reporting forces a separate load of repeated individual images? That is, I have a report where I show an image status on each line. There are only four images. Using the PictureBox with a valid URL ref for 4,000 lines in the report results in---4,000 calls to the server for the images. The report actually never completes.

Prior to the v701 2009 release I could work around this small problem of a completely non-functional report by the "hack" of using <img> in conjunction with TextBox. (In my case, clever user functions that detect Web output and strip out HTML ensure that PDF output is correct.) So, guys, what do I do now? I want to show an image for each line, but I can't do so using the "non-hack" methods.

Should I move to Crystal? Or simply explain that our reporting toolkit doesn't support images in a real-world environment (that is, for every databound line of a report).

Please, provide an option to trust your end-users rather than removing features. Here's my expression for the TextBox (which is unfortunately "automagically" cut off after 2 characters because I give it only 20px to work with...)

= ArchG2.Reporting.BaseReport.ArchG2SafeHtml(ArchG2.Reporting.BaseReport.ArchG2ImageRef(
ArchG2.Reporting.SrcToDestMapping.MappingImageType(Fields.MapStatus),20,20))

If only the TextBox would let the text go thru...problem solved (4,000 line report renders extremely quickly).
0
Steve
Telerik team
answered on 13 Aug 2009, 09:25 AM
Hello Manny,

We've returned the behavior back as it used to be prior to Q1 SP1 version. Please upgrade to Q2 SP1 and let us know if further help is needed.

Sincerely yours,
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
Stephen McDaniel
Top achievements
Rank 1
Answers by
Svetoslav
Telerik team
Stephen McDaniel
Top achievements
Rank 1
Steve
Telerik team
Manny
Top achievements
Rank 1
Share this question
or