Ⲁⲅⲅⲉⲗⲟⲥ
Ⲁⲅⲅⲉⲗⲟⲥ

Reputation: 668

Export telerik RadGrid to PDF

I have a Telerik RadGrid with NestedViewTemplate, when exporting it to PDF, it results in a corrupted file.

<NestedViewTemplate>
    <div runat="server" class="width-full">
        <span><%# Eval("Notes") %></span>
    </div>
</NestedViewTemplate>

Edit: the same grid but without this column (NestedViewTemplate) works fine and the export results in a well-formatted pdf file

Upvotes: 0

Views: 877

Answers (1)

Ⲁⲅⲅⲉⲗⲟⲥ
Ⲁⲅⲅⲉⲗⲟⲥ

Reputation: 668

I got it!

There is an exception log says:

Invalid XHTML. RadGrid has to render correct XHTML in order to export to PDF. Parse error: The 'br' start tag on line 778 position 6734 does not match the end tag of 'span'...

The note contains some HTML tags and the <br> tag is not valid XHTML tag, So, I replaced every <br> by <br/>, and it works properly now

Upvotes: 1

Related Questions