ExportToPdf broken for columns containing a link

5 posts, 0 answers
  1. david
    david avatar
    34 posts
    Member since:
    May 2008

    Posted 23 Jul 2008 Link to this post

    I have a column in my grid that I have changed the text to (something like) "<a href='#'>blah</a>" and the ExportToPdf no longer works. Sometimes it gives an xml error, sometimes it just produces a 0 byte pdf.

    I notice that if you just make the contents "<" the same thing happens. Looks like the converter is just assuming that the column values are plain text!

    My columns contain data that must be a valid link that the user can click on.

    Please advise.

    Thanks
  2. david
    david avatar
    34 posts
    Member since:
    May 2008

    Posted 23 Jul 2008 Link to this post

    Well, it's worse than I thought. Even if there is just a "<" (possibly other characters) in the DATA of the column, the converter barfs. I did not check this before because I just assumed the data would be sanitised either before display or at least before you guys tried to process the html as xml...

    Can you promote this forum post to a ticket or do I need to do that myself?

    Thanks.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 24 Jul 2008 Link to this post

    Hello David,

    This is a known issue with the PDF export feature which is mentioned in the bottom section of this RadGrid documentation topic:

    http://www.telerik.com/help/aspnet-ajax/grdexport.html

    You will need to ensure your grid content is valid XHTML and that you closed all tags within the grid body.

    Best regards,
    Stephen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. david
    david avatar
    34 posts
    Member since:
    May 2008

    Posted 24 Jul 2008 Link to this post

    Hello Stephen, thanks for your prompt reply,

    I was under the impression that the anchor tag was valid XHTML, see: http://www.w3schools.com/TAGS/tag_a.asp

    Please advise me if it is otherwise... It's not like I am plugging in naked < characters, the column text as far as I can see IS valid XHTML.

    Besides that, say there were other characters in there that were not valid, or say I were to want to remove the anchors before export, what mechanism do you provide for that? Is the only way to copy the entire grid to a new one and then export from that? How would to apply the filters and sorting orderings?

    I'm sorry but it still looks like a bug to me. It should be the grid's job to ensure that its own output is compatible with functions that it claims to provide over that data at a later point in time. From my perspective, I am just providing the grid with a dataset that came from a database - I am not manipulating each cell's text value before giving it to the grid...

    Thanks. Hopefully you can get back to me quickly as this issue is now fairly urgent... The export was working, but now that I see some real data there are anchors (hyperlinks) within the text for some columns.
  6. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 25 Jul 2008 Link to this post

    Hello David,

    As I can see you are using:
    "<href='#'>blah</a>"  

    The "#" symbol is not valid XHTML. You can escape it and have your anchor tag like this
    <href="%23">Your text</a> 
    This is working just fine.

    Regarding your other questions:
    I suggest you visit the RadGrid export section in our online help.  You can use IgnorePaging property to specify whether all records will be exported or merely those on the current page. Find the rest of the properties listed in the linked article.

    Best regards,
    Nikolay
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017