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

PDF Export Error

3 Answers 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John John
Top achievements
Rank 1
John John asked on 01 Mar 2010, 12:56 PM
Hi,
      I am getting the follwing error while exporting PDF file. I used the following formatted text in grid "Workers Compensation Information[binary]"  in one of the column.I assume the error mainly comes due to using non unicode character. So i would like to know how to avoid the following error and also how to replace the appropriate character symbols with matching text. Since i am using lot of symbol related characters it would be more helpful to me to track error.

My error message is:

Invalid XHTML. RadGrid has to render correct XHTML in order to export to PDF.
Parse error:
Reference to undeclared entity 'W'. Line 2004, position 75.
at line:
Louisiana Workers' Compensation Notice (B&W; English)<i>[binary]</i>

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Telerik.Web.UI.Grid.Export.GridPdfExportException: Invalid XHTML. RadGrid has to render correct XHTML in order to export to PDF.
Parse error:
Reference to undeclared entity 'W'. Line 2004, position 75.
at line:
Louisiana Workers' Compensation Notice (B&W; English)<i>[binary]</i>


-Thanks

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 01 Mar 2010, 02:16 PM
Hello John,

Please replace the semicolon character with its HTML code representation and let me know whether this helps:
Louisiana Workers' Compensation Notice (B&W&#59; English)<i>[binary]</i>
HTML Codes for Punctuation and Other Characters

This is not a valid XHTML-compliant code and therefore the parser throws an exception. You could try to validate your code here:
W3C Markup validator

Kind regards,
Daniel
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.
0
Dasha
Top achievements
Rank 1
answered on 13 Mar 2012, 05:52 PM
Hello Daniel,

How would you suggest we deal with dynamic html that's being exported and there's a chance that the data comes in damaged?  I'd hate for our customers to see their screen blow up because there are some quotes or closing tags missing.  The customers are not expected to know html or any of the code insides.  Is there any html validation method you can recommend that I can apply server-side before the export takes place?

Thank you,

Dasha.
0
Daniel
Telerik team
answered on 16 Mar 2012, 03:19 PM
Hello Dasha,

You can just enable the HtmlEncode property for your data columns.
<telerik:GridBoundColumn HtmlEncode="true" ... />

For template columns you could use the Server.HtmlEncode() method.

Best regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
John John
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Dasha
Top achievements
Rank 1
Share this question
or