您可以設置導出設置你radgrid控件,像這樣:
RadGrid1.ExportSettings.FileName = "File Name"
RadGrid1.ExportSettings.ExportOnlyData = True
RadGrid1.ExportSettings.IgnorePaging = True
RadGrid1.ExportSettings.OpenInNewWindow = True
RadGrid1.ExportSettings.Pdf.PageHeight="162mm"
RadGrid1.ExportSettings.Pdf.PageWidth="600mm"
RadGrid1.ExportSettings.Pdf.PageTitle="Payment Orders"
RadGrid1.ExportSettings.Pdf.DefaultFontFamily="Arial Unicode MS"
RadGrid1.ExportSettings.Pdf.Title="Payment Orders"
RadGrid1.ExportSettings.Pdf.PageBottomMargin="50mm"
RadGrid1.ExportSettings.Pdf.PageTopMargin="35mm"
RadGrid1.ExportSettings.Pdf.PageLeftMargin="150mm"
RadGrid1.ExportSettings.Pdf.PageRightMargin="50mm"
RadGrid1.ExportSettings.Pdf.Author="AbdanSoftware"
RadGrid1.ExportSettings.Pdf.PaperSize="A4"
編輯:要在導出中包含css,您可以在HTMLExporting
事件中爲Word和Excel格式執行此操作。 僅適用於PDF導出僅內聯樣式。
Private Sub RadGrid1_HTMLExporting(sender As Object, e As Telerik.Web.UI.GridHTMLExportingEventArgs) Handles RadGrid1.HTMLExporting
Dim css As String = "body { color: red; }"
e.Styles.Append(css)
End Sub
看看this documentation上的Word/Excel導出更多的幫助,併爲this documentation PDF導出幫助。
你讓我錯了...在我的問題代碼ExportSettings沒有一個屬性導出網格與相同的網格CSS ..所以有什麼辦法導入我的網格CSS並將其應用到導出PDF文件文件也.... – Mahmoud
請參閱編輯,爲答案在css出口 – kavun
非常感謝..讚賞 – Mahmoud