private void Download_Click(object sender, EventArgs e) { var store = typeof(AuditLogEntry).GetStore(); var entries = store.Items <AuditLogEntry>() .Where(log => log.PluginId == PluginId) .OrderByDescending(log => log.Timestamp); var content = new ExcelFeedGenerator().ExcelFeedFor(entries); var context = HttpContext.Current; context.Response.Clear(); context.Response.AddHeader("content-disposition", string.Format("attachment;filename=AuditLogExport_PluginId_{0}.xls", PluginId)); context.Response.ContentType = "application/ms-excel"; context.Response.Charset = ""; context.Response.Write(content); context.Response.End(); }
private void Download_Click(object sender, EventArgs e) { var store = typeof(AuditLogEntry).GetStore(); var entries = store.Items<AuditLogEntry>() .Where(log => log.PluginId == PluginId) .OrderByDescending(log => log.Timestamp); var content = new ExcelFeedGenerator().ExcelFeedFor(entries); var context = HttpContext.Current; context.Response.Clear(); context.Response.AddHeader("content-disposition", string.Format("attachment;filename=AuditLogExport_PluginId_{0}.xls", PluginId)); context.Response.ContentType = "application/ms-excel"; context.Response.Charset = ""; context.Response.Write(content); context.Response.End(); }