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

Exporting to PDF

1 Answer 84 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Surya
Top achievements
Rank 1
Surya asked on 21 Aug 2012, 11:14 AM
Hi

I tried by  exporting Grid view to PDF using "ExportToPDF" , but its not exported with the actual alignment as in Grid . the Column names are getting overlapped by shrinking its size and last column name is out of Grid Border .I attached the sample image of the exported PDF for your reference.


Following properties were setting:

                         objExportPDF.PdfExportSettings.EnablePrinting = true;
                        objExportPDF.ExportVisualSettings = true;
                        objExportPDF.TableBorderThickness = 0;
                        objExportPDF.Scale = 1.2f;
                        objExportPDF.PdfExportSettings.PageWidth = radGridStaticTable.Width / 2;
                        objExportPDF.PdfExportSettings.PageHeight = 210;

Please check following code in htmlCellformatting event :

void objExportPDF_HTMLCellFormatting(object sender, Telerik.WinControls.UI.Export.HTML.HTMLCellFormattingEventArgs e)
        {

            e.HTMLCellElement.Alignment = ContentAlignment.MiddleLeft;
            e.GridCellInfo.ColumnInfo.HeaderTextAlignment = ContentAlignment.MiddleLeft;
            e.HTMLCellElement.Styles.Add("border", "solid");

        }


PFA

1 Answer, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 23 Aug 2012, 04:03 PM
Hello Surya,

Thank you for writing.

Currently, the export to PDF does not offer a way to enable auto ellipsis and there is no easy way to enable it for HTML. For the moment there is no workaround other than to try and reduce the amount of data that is being exported or to try and resize the columns in a way that will allow you to see all the content.

I hope this will be informative. If you have further questions, do not hesitate to write back.
 
Regards,
Ivan Petrov
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
Surya
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Share this question
or