You can specify the username and password to access your SSRS report by setting the Credential property in C1SSRSDocumentSource's SecurityError event. This event will be fired and will allow you to provide the required credentials and retry the operation, when access to the SSRS server is denied due to lack of credentials.
c1SSRSDocumentSource1_SecurityError
event handler as shown below:
C# |
Copy Code
|
---|---|
private void c1SSRSDocumentSource1_SecurityError(object sender, C1.Win.C1Document.SecurityErrorEventArgs e) { var ds = (C1.Win.C1Document.C1SSRSDocumentSource)sender; ds.Credential = new System.Net.NetworkCredential("myUserId", "myPassword"); e.Retry = true; } |
Visual Basic |
Copy Code
|
---|---|
Private Sub C1SSRSDocumentSource1_SecurityError(sender As Object, e As C1.Win.C1Document.SecurityErrorEventArgs) Handles C1SSRSDocumentSource1.SecurityError Dim ds = DirectCast(sender, C1.Win.C1Document.C1SSRSDocumentSource) ds.Credential = New System.Net.NetworkCredential("myUserId", "myPassword") e.Retry = True End Sub |
In the code above, replace "myUserId" and "myPassword" with valid credentials for your SSRS report server. When your form loads, the C1SSRSDocumentSource component will try to access the specified report.
Note: Using improper credentials will throw a security error. So, you must specify a handler that will allow you to provide valid credentials and retry the operation. |