Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
JagadishNallami
Frequent Visitor

Underlying connection was closed error in SSRS when accessing a report

Hi There,

 

I am using SSRS reports in my Windows application using Report viewer in Winforms. I am getting the below exception while trying to get the report.

 

Exception message: The underlying connection was closed: The connection was closed unexpectedly.
Stack trace: at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.GetWebResponse(WebRequest request)
at Microsoft.Reporting.WinForms.ServerReportSoapProxy.GetWebResponse(WebRequest request)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.ReportExecutionService.LoadDrillthroughTarget2(String DrillthroughID)
at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.<>c__DisplayClass1e.<LoadDrillthroughTarget>b__1c()
at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.ProxyMethodInvocation.Execute[TReturn](RSExecutionConnection connection, ProxyMethod`1 initialMethod, ProxyMethod`1 retryMethod)
at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.LoadDrillthroughTarget(String DrillthroughID)
at Microsoft.Reporting.WinForms.ServerReport.PerformDrillthrough(String drillthroughId, String& reportPath)
at Microsoft.Reporting.WinForms.ReportViewer.RenderDrillthrough(DrillthroughAction action)
at Microsoft.Reporting.WinForms.ReportViewer.FireAnAction(Action action, Boolean shiftKeyDown)

 

However, when I checked my SSRS server logs , I didn't see any errors. 

 

What could be the possible reason for this error? Is this could be due to the issue with report viewer? Any properties I need to set?

1 ACCEPTED SOLUTION
AmiraBedh
Super User
Super User

I think there are some network issues between your client machine and your SSRS server. You can use tools like ping or tracert to diagnose network connectivity problems.

If your SSRS server is configured to use HTTPS, the client should be the correct TLS/SSL version. Older versions of the .NET Framework may not support newer TLS versions by default. You can enforce the use of a specific TLS version in your application by adding the following code:

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

Genreally, if the SSRS server is under heavy load or running out of memory, it might close connections unexpectedly. 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

View solution in original post

1 REPLY 1
AmiraBedh
Super User
Super User

I think there are some network issues between your client machine and your SSRS server. You can use tools like ping or tracert to diagnose network connectivity problems.

If your SSRS server is configured to use HTTPS, the client should be the correct TLS/SSL version. Older versions of the .NET Framework may not support newer TLS versions by default. You can enforce the use of a specific TLS version in your application by adding the following code:

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

Genreally, if the SSRS server is under heavy load or running out of memory, it might close connections unexpectedly. 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.