Этот код запускается при нажатии кнопки на моей странице:
protected void btnExportToPdfButton_click(object sender, EventArgs e)
{
this.ProjectListGrid.ExportSettings.ExportOnlyData = true;
this.ProjectListGrid.ExportSettings.Pdf.PageLeftMargin = Unit.Parse(".2in");
this.ProjectListGrid.ExportSettings.Pdf.PageRightMargin = Unit.Parse(".2in");
ApplyStylesToPdfExport(this.ProjectListGrid.MasterTableView);
this.ProjectListGrid.MasterTableView.ExportToPdf();
}
public void ApplyStylesToPdfExport(GridTableView tableView)
{
// Get access to the header in the grid
GridItem headerItem = tableView.GetItems(GridItemType.Header)[0];
// Apply CSS Styles to the header
headerItem.Style["font-size"] = "8pt";
headerItem.Style["background-color"] = "#777";
headerItem.Style["color"] = "white";
// Apply CSS Styles to each cell in the header
foreach (TableCell cell in headerItem.Cells)
{
cell.Style["color"] = "red";
}
}
Экспорт в PDF, просто без применения пользовательских стилей.Я абсолютно не знаю, что я делаю неправильно.