.Net mvc 4 application is using SSRS 2012 reporting service to extract report data in excel. We have below code snippet to extract data to excel.
ServerReport rpt = new ServerReport
{
ReportServerUrl = new Uri(ViewBag.ReportServerUrl),
ReportPath = ViewBag.ReportPath//,
};
//rpt.ReportServerCredentials = new NetworkCredential();
rpt.SetParameters(parameters);
string encoding;
string deviceInfo =
"<DeviceInfo>" +
" <OutputFormat>EXCELOPENXML</OutputFormat>" +
"<HTMLFragment>true</HTMLFragment>" +
"</DeviceInfo>";
Warning[] warnings;
string[] streams;
return rpt.Render(
reportType,
deviceInfo,
out mimeType,
out encoding,
out fileNameExtension,
out streams,
out warnings);
Export to excel is failing for report having close to 3000 tabs. Same report is taking more than 30 min to run through SSRS and do not throw any error.
But when we run report through web application report run is failing exactly at 5 min.
below error is getting logged on webserver and reportserver log.
Web.configuration:
Message: The underlying connection was closed: An unexpected error occurred on a receive.
Title:System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
InnerException# 1 - Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
InnerException# 2 - Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
Report server:
RunningJobContext.IsClientConnected; found orphaned request xuxj0j550czlk3il0ix30zrf
DataPrefetch abort handler called for Report with ID=. Aborting data sources ...
INFO: RunningJobContext.IsClientConnected; found orphaned request xuxj0j550czlk3il0ix30zrfINFO: DataPrefetch abort handler called for Report with ID=. Aborting data sources ...
INFO: RenderForNewSession('/Shared Reports/Standard Reports/Compensation Detail')
We have confirmed all timeout in report server, web, sql and all are having correct values.
Please suggest.