function OpenAdvertisedDialog() { var dialogOptions = { url: "/_layouts/apply/reports/advertised_billets.aspx", autoSize: true, allowMaximize: false, dialogReturnValueCallback: onCloseCallback }; SP.UI.ModalDialog.showModalDialog(dialogOptions) } function onCloseCallback(dialogResult, returnValue) { SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK); } Here is code behind creating XLS private void ExportToExcel() { //Export the GridView to Excel PrepareGridViewForExport(gvReport); string style = @"<style> .text { mso-number-format:\@; } </style> "; string attachment = "attachment; filename=Advertised Billets Report.xls"; Response.ClearContent(); Response.AddHeader("content-disposition", attachment); Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; StringWriter sw = new StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); gvReport.RenderControl(htw); Response.Write(style); Response.Write(sw.ToString()); Response.End(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)