i have an asp.net-mvc web page and i am using jqgrid on the front end. i want to have an export to excel button that will export the current set of data (based on the curr
I succeed to make filtered export, taking inspiration by above @simpatric greg solution.
I set one session variable for each grid parameter, when data is requested and then passing again them to the excel export service. Greg's solution can work with asp.net MVC, which is ok for the main question. The following solution could be used with standard pure js jqgrid too:
CONTROLLER GRID ACTION
...
Session["jqsidx"] = sidx;
Session["jqsord"] = sord;
Session["jqpage"] = page;
Session["jqrows"] = rows;
Session["jq_search"] = _search;
Session["jqfilters"] = filters;
....
RECALLED INSIDE OF EXCEL EXPORT ACTION ^^
string sidx = Session["jqsidx"] as String;
string sord = Session["jqsord"] as String;
int? page = Session["jqpage"] as Nullable;
int? rows = Session["jqrows"] as Nullable;
bool? _search = Session["jq_search"] as Nullable;
string filters = Session["jqfilters"] as String;
var query = myqueryservice.getGridData(sidx, sord, (int)page, (int)rows, (bool)_search, filters, urlparams).ToList();
...
I hope this may help for other people having the same problem with standard jqgrid.