Showing Grid in exported PDF

12 posts, 0 answers
  1. Andreas Mildenberger
    Andreas Mildenberger avatar
    9 posts
    Member since:
    Mar 2010

    Posted 23 Feb 2011 Link to this post

    Hello,

     

    I already export my radGridView to PDF with the following code:

      

    Telerik.WinControls.UI.Export.ExportToPDF exportPDF = new Telerik.WinControls.UI.Export.ExportToPDF(radGridView);

                   

    exportPDF.PdfExportSettings.Title = "Title";

    exportPDF.SummariesExportOption = Telerik.WinControls.UI.Export.SummariesOption.ExportAll;

    exportPDF.ExportVisualSettings = true;
    exportPDF.TableBorderThickness = 10;

    exportPDF.PdfExportSettings.PageWidth = 600;

    exportPDF.PdfExportSettings.PageHeight = 950;

    exportPDF.FitToPageWidth = true;

      

    but no matter how I set the TableBorderThickness property, there is no difference in the PDF…

     

    1. I want to be able to hide the border around my table on every page
    2. I want to show the whole Grid ( border around every cell ),

    How can I implement these 2 cases?

    Regards,


    Stefan 

  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 23 Feb 2011 Link to this post

    Hello,

    Whilst I agree that the TableBorder property seems to have no effect, you can set a border for all of the cells by subscribing to the HTMLCellFormattingEventHandler

    exportPDF.HTMLCellFormatting += new Telerik.WinControls.UI.Export.HTML.HTMLCellFormattingEventHandler(exportPDF_HTMLCellFormatting);

    void exportPDF_HTMLCellFormatting(object sender, Telerik.WinControls.UI.Export.HTML.HTMLCellFormattingEventArgs e)
    {
        e.HTMLCellElement.Styles.Add("border-style", "solid");
    }

    Hope this helps but let me know if you need more information
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Andreas Mildenberger
    Andreas Mildenberger avatar
    9 posts
    Member since:
    Mar 2010

    Posted 23 Feb 2011 Link to this post

    That works fine for showing the whole grid, thanks!

    But if I don't want to show the whole grid, there though is a border line around the grid... how can I hide it?
  5. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 23 Feb 2011 Link to this post

    Hello,

    Glad that helped.
    Regarding the outer border, as per my post and your original obervaton, this unfortunatly seems to have no effect in the current version. I have checked in the Public Issue Tracking system and have not found a record of this as a known issue. If I can find a workaround for this, I'll let you know.

    In the meantime, may I ask that you mark the previous reply as answer.
    I'll get back to you if I can find a way to turn off the outer table border
    Thanks
    Richard
  6. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 28 Feb 2011 Link to this post

    Hello guys,

    It is true that TableBorderThickness property does not work. This issue is related to the pdf conversion library, which we are using. We will investigate this further and improve our export capabilities in one of the next releases. Please excuse us for the inconvenience.

    Regards,
    Martin Vasilev
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  7. Taylor
    Taylor avatar
    17 posts
    Member since:
    Mar 2011

    Posted 25 Nov 2011 Link to this post

    The last post, from 9 months ago, mentioned that the TableBorderThickness property was broken and would be investigated and corrected in an upcoming release.  It does not appear to be working in recent releases I have tried.  Has this been corrected yet?  If not, is there any workaround?
  8. Ivan Petrov
    Admin
    Ivan Petrov avatar
    701 posts

    Posted 29 Nov 2011 Link to this post

    Hi Taylor,

    Thank you for writing.

    The issue has been addressed and will not be present in our upcoming service pack. There are still, however, some limitations coming from the PDF conversion library, that we use, which would not allow you to set a border thickness of 0. Even if you do so, the border will be drawn with 1 pixel width.

    I hope this will be useful. Should you have further questions, I would be glad to help.

    Best wishes,
    Ivan Petrov
    the Telerik team

    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

  9. Taylor
    Taylor avatar
    17 posts
    Member since:
    Mar 2011

    Posted 20 Mar 2012 Link to this post

    Has this been resolved yet so the entire table can be drawn without a border?
  10. Ivan Petrov
    Admin
    Ivan Petrov avatar
    701 posts

    Posted 21 Mar 2012 Link to this post

    Hi Todd,

    Thank you for writing.

    As I mentioned in my previous post, this limitation comes form the third party conversion library we are using. Currently, we cannot do anything to change its behavior.

    If you have other questions, I would be glad to help.

    Kind regards,
    Ivan Petrov
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  11. KUMARAN
    KUMARAN avatar
    28 posts
    Member since:
    May 2014

    Posted 16 Apr 2015 in reply to Ivan Petrov Link to this post

    exportPDF.HTMLCellFormatting += new Telerik.WinControls.UI.Export.HTML.HTMLCellFormattingEventHandler(exportPDF_HTMLCellFormatting);




    void exportPDF_HTMLCellFormatting(object sender, Telerik.WinControls.UI.Export.HTML.HTMLCellFormattingEventArgs e)
    {
        e.HTMLCellElement.Styles.Add("border-style", "solid");
    }

    How to use this code in VB.

  12. KUMARAN
    KUMARAN avatar
    28 posts
    Member since:
    May 2014

    Posted 17 Apr 2015 in reply to KUMARAN Link to this post

    I found it.

    http://www.telerik.com/forums/export-to-pdf-csv-html 

    Thanks.

  13. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 17 Apr 2015 Link to this post

    Hello Kumaran,

    Thank you for writing.

    You can refer to our Export to PDF help article which includes a VB.NET example as well.

    Additionally, feel free to use our online converter which converts code from C# to VB and from VB to C#.

    I hope this information helps. Should you have further questions, I would be glad to help.
     
    Regards,
    Dess
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top
UI for WinForms is Visual Studio 2017 Ready