Export to PDF

6 posts, 2 answers
  1. Dean
    Dean avatar
    43 posts
    Member since:
    Jun 2009

    Posted 15 Dec 2010 Link to this post

    Good Day,

    I've got a grid with a whole bunch of columns which I'm exporting to HTML,CSV and Excel with no problems at all, but when I export the grid to PDF my column data overlaps as shown in the below image link.

    http://www.mediafire.com/?3crbrazsocq9n5x

    Here are the settings below I'm using for my export and I'm using Adobe Reader 9 to view the PDF. I'm using the Telerik WinForms Q3 2010 Control Set - v2010.3.10.1109

    Private Sub ExportToPDF(ByVal sFileName As String, ByVal oRadGridView As RadGridView, ByRef bOpenExportFile As Boolean)
            Dim exporter As Export.ExportToPDF = New Export.ExportToPDF(oRadGridView)
            exporter.HiddenColumnOption = Telerik.WinControls.UI.Export.HiddenOption.DoNotExport
            exporter.PdfExportSettings.PageHeight = 210
            exporter.PdfExportSettings.PageWidth = 297
            exporter.Scale = 1
            exporter.FitToPageWidth = True
            exporter.ExportVisualSettings = True
            exporter.RunExport(sFileName)
            bOpenExportFile = AskToOpen(oRadGridView)
        End Sub

    Thank You
  2. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 15 Dec 2010 Link to this post

    I'm afraid, that is a limitation with the current version of the control.

    IMHO PDF export is not really working except for the most simple case where all data fits on a page
    (but nice to tick as a feature in the various component comparison charts anyway)

    What I'd like to see is true printing / print prview support similar to what Excel 2010 provides for printing spreadsheets.
    Then the user can also print to a PDF engine if he so wishes.

    Regards



  3. UI for WinForms is Visual Studio 2017 Ready
  4. Answer
    Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 20 Dec 2010 Link to this post

    Hi Dean,

    Erwin is right and overlapping is a result of the current PDF library limitation. More specifically, it does not support word-break and cannot wrap words. The only way to overcome this issue is to tune your table size through the Scale property. You can try with values lower than 1.

    Best wishes,
    Martin Vasilev
    the Telerik team
    Check out the Q1 2011 Roadmap for Telerik Controls for Windows Forms.
  5. Dean
    Dean avatar
    43 posts
    Member since:
    Jun 2009

    Posted 20 Dec 2010 Link to this post

    Hi Martin,

    Thank you very much for the reply, are there any upcoming plans for reviewing/updating the currently used PDF Library. I will reduce the Scale property as you have suggested.

    Kind Regards
  6. Ramius
    Ramius avatar
    127 posts
    Member since:
    Feb 2008

    Posted 20 Dec 2010 Link to this post

    Hi Martin,

    Why is that bug still not fixed in the PDF-Library you use ?

    Can't you use an other PDF-Library instead ?

    Until this bug is not fixed i can't offer the PDF-Export to my customers.

    Kind Regards,

    Ramius

  7. Answer
    erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 21 Dec 2010 Link to this post

    Hi Ramius,

    clean printing of a grid control in a generalized manner is extremely complex since a grid can scroll and has therefore a potentially "unlimited" page size. Now if you have to break that down into printer pages, you have to make assumptions/compromises or provide a printing engine that is potentially at least as complex to write and to use from your code as the grid itself.

    So far, I have not yet found a way for my users to have a very flexible and configurable data display tool such as the RadGrid (with loadable layouts) and at the same time the ability to cleanly print the contents. So I ended up writing a bunch of reports that print cleanly but are less flexible.
    A possible work-around is to export the grid to Excel and print (also to XPS/PDF) the data from there.

    regards
    Erwin
Back to Top
UI for WinForms is Visual Studio 2017 Ready