IReportServerCredentials Interface


Allows applications to provide credentials for connecting to a Reporting Services report server.

Namespace:   Microsoft.Reporting.WebForms
Assembly:  Microsoft.ReportViewer.WebForms (in Microsoft.ReportViewer.WebForms.dll)

public interface class IReportServerCredentials


Gets or sets the System.Security.Principal::WindowsIdentity of the user to impersonate when the ReportViewer control connects to a report server.


Gets or sets the network credentials that are used for authentication with the report server.

System_CAPS_pubmethodGetFormsCredentials(Cookie^, String^, String^, String^)

Provides information that will be used to connect to the report server that is configured for forms authentication.

When implementing the IReportServerCredentials interface, it is important know that the ReportViewer control stores the instance of the object in ASP.NET session. If the server's ASP.NET session is being stored out of process, such as in Reporting Services, the class must be marked Serializable so that it may be serialized for storage.

Although it is not required, it is also a good practice to implement the IReportServerCredentials interface as a stateless object. This prevents the credential information, such as user name and password, from being stored when the object is serialized.

For more information about how to specify credentials with the ReportViewer control, see Specifying Connections and Credentials for the ReportViewer Web Server Control.

Legacy Code Example

The following example provides an implementation of IReportServerCredentials that is marked Serializable so that it can be serialized for storage. The credential information is retrieved from the Web.config file. This implementation will connect to the report server with the same credentials for all client requests.

Before using the example, three key value pairs must be added to the application's Web.config file in the appSettings block: MyReportViewerUser, MyReportViewerPassword, and MyReportViewerDomain. These values correspond to the user name, password, and domain that will be used to connect to the report server.

No code example is currently available or this language may not be supported.
Return to top