private void ExportGrid() { xls.ExportStructure structure = new xls.ExportStructure(); structure.Tables.Add(table); xls.XlsBiffRenderer renderer = new xls.XlsBiffRenderer(structure); byte[] renderedBytes = renderer.Render(); Response.Clear(); Response.AppendHeader("Content-Disposition:", "attachment; filename=ExportFile.xls"); Response.ContentType = "application/vnd.ms-excel"; Response.BinaryWrite(renderedBytes); Response.End(); }
private void ExportGrid() { xls.ExportStructure structure = new xls.ExportStructure(); structure.Tables.Add(table); xls.XlsBiffRenderer renderer = new xls.XlsBiffRenderer(structure); byte[] renderedBytes = renderer.Render(); Response.Clear(); Response.AppendHeader("Content-Disposition:", "attachment; filename=ExportFile.xls"); Response.ContentType = "application/vnd.ms-excel"; Response.BinaryWrite(renderedBytes); Response.End(); }