Long running report is failing to run after 5 min to extract output in excel

.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 xuxj0j550czlk3il0ix30zrf

                              INFO: 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.

September 8th, 2015 1:23am

Hi Ajit, 

Based on the error message, the cause of this issue may be the "SecureConnectionLevel" element has a wrong value. We can set the "SecureConnectionLevel" to 1 or 2 only when we configure the Report Server for SSL connections. Please refer to this thread: The underlying connection was closed: An unexpected error occurred on a send.

If you have any other question, please feel free to ask.

Regards,
Shrek Li

September 8th, 2015 3:23am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics