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

Export to PDF

5 Answers 299 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dean
Top achievements
Rank 2
Dean asked on 15 Dec 2010, 10:37 AM
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

5 Answers, 1 is accepted

Sort by
0
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 15 Dec 2010, 06:30 PM
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



0
Accepted
Martin Vasilev
Telerik team
answered on 20 Dec 2010, 03:08 PM
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.
0
Dean
Top achievements
Rank 2
answered on 20 Dec 2010, 04:47 PM
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
0
Ramius
Top achievements
Rank 1
answered on 21 Dec 2010, 01:14 AM

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

0
Accepted
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 21 Dec 2010, 01:25 PM
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
Tags
GridView
Asked by
Dean
Top achievements
Rank 2
Answers by
erwin
Top achievements
Rank 1
Veteran
Iron
Martin Vasilev
Telerik team
Dean
Top achievements
Rank 2
Ramius
Top achievements
Rank 1
Share this question
or