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
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