Hi. Is there a way to Export the data from a Filtered Grid without exporting the controls in the Command Item Template? The ExportDataOnly does not appear to do the trick.
Everything about Exporting is working great from within the command item template until I apply a filter. The controls are being exported and look horrible (not rendered properly, etc).
Two side notes: 1) Exporting to CSV works fine with the filter (no controls) and 2) PDF's simply don't work- I get a "System.SystemException: Telerik.Web.Apoc.ApocException: fo:block must be child of fo:basic-link ... " exception.
My grid's item command method:
Please advise.
Thank you,
Tom
Everything about Exporting is working great from within the command item template until I apply a filter. The controls are being exported and look horrible (not rendered properly, etc).
Two side notes: 1) Exporting to CSV works fine with the filter (no controls) and 2) PDF's simply don't work- I get a "System.SystemException: Telerik.Web.Apoc.ApocException: fo:block must be child of fo:basic-link ... " exception.
My grid's item command method:
case "Export": |
{ |
GridCommandItem item = e.Item as GridCommandItem; |
CheckBox cbIgnorePaging = item.FindControl("cbIgnorePaging") as CheckBox; |
RadComboBox rddlExport = item.FindControl("rddlExport") as RadComboBox; |
rgDigitalCertificateAssignments.ExportSettings.OpenInNewWindow = true; |
rgDigitalCertificateAssignments.ExportSettings.ExportOnlyData = true; |
rgDigitalCertificateAssignments.ExportSettings.IgnorePaging = cbIgnorePaging.Checked; |
rgDigitalCertificateAssignments.ExportSettings.FileName = "CertificateHistory"; |
switch (rddlExport.SelectedValue) |
{ |
case "excel": |
{ |
rgDigitalCertificateAssignments.MasterTableView.GridLines = GridLines.Both; |
rgDigitalCertificateAssignments.ExportSettings.Excel.Format = GridExcelExportFormat.Html; |
rgDigitalCertificateAssignments.MasterTableView.ExportToExcel(); |
break; |
} |
case "word": |
{ |
rgDigitalCertificateAssignments.MasterTableView.ExportToWord(); |
break; |
} |
case "csv": |
{ |
rgDigitalCertificateAssignments.ExportSettings.Csv.ColumnDelimiter = GridCsvDelimiter.Tab; |
rgDigitalCertificateAssignments.MasterTableView.ExportToCSV(); |
break; |
} |
case "pdf": |
{ |
rgDigitalCertificateAssignments.ExportSettings.Pdf.AllowAdd = false; |
rgDigitalCertificateAssignments.ExportSettings.Pdf.AllowCopy = true; |
rgDigitalCertificateAssignments.ExportSettings.Pdf.AllowModify = false; |
rgDigitalCertificateAssignments.ExportSettings.Pdf.AllowPrinting = true; |
rgDigitalCertificateAssignments.MasterTableView.ExportToPdf(); |
break; |
} |
} |
break; |
} |
} |
Thank you,
Tom