Hello,
I updated paramQuery from v8.2.1 to v9.0.2. With this change, my export to excel has stopped working. I am using .net for server code. Below is my code which was working for v8.2.1 but now noting happens when ExportGridView() is called. Even it is not calling server side code. I did put debugger at server side but nothing happened.
JS code
===============
function ExportGridView() {
gridApi.exportData({
url: pageURL + "/exportData",
format: 'xlsx',
nopqdata: true,
render: false,
sheetName: 'Team Assignments',
filename: "WFP_TeamAssignments " + moment().format('DD-MMM-YYYY') + '.xlsx'
});
}
.net code
===============
[HttpPost, ValidateInput(false)]
public string exportData(string pq_ext, string pq_data, bool pq_decode, string pq_filename)
{
System.Web.HttpContext.Current.Application["pq_data"] = pq_data;
System.Web.HttpContext.Current.Application["pq_decode"] = pq_decode;
System.Web.HttpContext.Current.Application["pq_filename"] = pq_filename;
return pq_filename;
}
[HttpGet]
public FileContentResult exportData(string pq_filename)
{
String contents = System.Web.HttpContext.Current.Application["pq_data"].ToString();
byte[] bytes = ((bool)System.Web.HttpContext.Current.Application["pq_decode"]) ? Convert.FromBase64String(contents) :
new System.Text.UTF8Encoding().GetBytes(contents);
return File(bytes, "application/octet-stream", pq_filename);
}
Please help me to get this issue resolved.
Thanks