This question is locked. New answers and comments are not allowed.
Hi,
I need to add a title above the header row of a grid when exporting to Excel. So we need to have "For Official Use Only" appear in any Excel Worksheet that is created as a result of exporting from a Grid. I've seen some examples, but they seem to only work if the format used for export is HTML. We need to use ExcelML as seen here:
Is there a way to accomplish this, using this export format?
Thanks,
Mike
I need to add a title above the header row of a grid when exporting to Excel. So we need to have "For Official Use Only" appear in any Excel Worksheet that is created as a result of exporting from a Grid. I've seen some examples, but they seem to only work if the format used for export is HTML. We need to use ExcelML as seen here:
protected override void OnClick() { base.OnClick(); try { string extension = ""; extension = "xml"; SaveFileDialog dialog = new SaveFileDialog(); dialog.DefaultExt = extension; dialog.Filter = String.Format( "{1} files (*.{0})|*.{0}|All files (*.*)|*.*", extension, "Excel" ); dialog.FilterIndex = 1; if (dialog.ShowDialog() == true) { using (Stream stream = dialog.OpenFile()) { GridViewExportOptions exportOptions = new GridViewExportOptions(); exportOptions.Format = ExportFormat.ExcelML; exportOptions.ShowColumnFooters = true; exportOptions.ShowColumnHeaders = true; exportOptions.ShowGroupFooters = false; GridToExport.Export( stream, exportOptions ); } } } catch (Exception ex) { throw ex; } }Is there a way to accomplish this, using this export format?
Thanks,
Mike