I am working on MVC-5, I have scenario where I am downloading Excel,PDF,DOC files using jquery get function. Below is code snippet:-
var url = '@Html.Raw(@Url.Action("RendertoEXCEL", "Reports", new { ObjSSRSExportTemplates = @Html.Raw(Json.Encode(@ViewBag.ExportObj)) })) ';
$.get(url, function (res)
{
window.location = url;
$("#ResultConsReport").mLoading('hide');
});
Action Level Code IS as below:-
public ActionResult RendertoEXCEL(string ObjSSRSExportTemplates)
{
byte[] ReadRequest = null;
JavaScriptSerializer js = new JavaScriptSerializer();
ExportReportConfig objExport = js.Deserialize<ExportReportConfig>(ObjSSRSExportTemplates);
string RptFomrat = "EXCEL";
SSRSReportManager rptManager = new SSRSReportManager(RServiceURL, RptUserName, RptPassword);
ReadRequest = rptManager.ExportReport(RDirName, objExport.ReportName, RptFomrat, objExport.parmaters);
return File(ReadRequest, "application/vnd.ms-excel", "Report.xls");
}
It working very fine, but when in case parameter length size extends. It throws error :
The length of the query string for this request exceeds the configured maxQueryStringLength value.
I googled and increase:
maxUrlLength="10999" maxQueryStringLength="2097151"
in web config but not working. Is there any solution for increase maximum length size of querystring?