您可以像这样为您的 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
查看此文档以获取有关 Word/Excel 导出的更多帮助,以及此文档以获取 PDF 导出帮助。