protected void Page_Load(object sender, EventArgs e) { string actionKey = string.Empty; if (Request.QueryString.AllKeys.Contains("actionKey")) { actionKey = Request.QueryString["actionKey"]; } QueryStringInfo queryStringInfo = new QueryStringInfo().Fill(Request.QueryString); Response.Clear(); JQGrid grid = new Custom_PerFormsService().GetJQGrid(actionKey, null, queryStringInfo); Response.Write(new JSON().Serialize(grid)); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { string actionKey = string.Empty; if (Request.QueryString.AllKeys.Contains("actionKey")) { actionKey = Request.QueryString["actionKey"]; } DataTable dt = new Custom_PerFormsService().GetDataTableAll(actionKey, null); string fileName = "report.xls"; string mimeType = new MIMEType().GetMIMEType(new MIMEType().GetExtension(fileName)); byte[] buffer = new Excel().GetExcelBufferFromDataTable(dt); Response.Clear(); Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", fileName)); Response.ContentType = mimeType; Response.OutputStream.Write(buffer, 0, buffer.Length); Response.OutputStream.Close(); Response.End(); }