In most cases, you can retrieve any credentials required for data access from the user via the data source prompt. However, in the case of automated reports where there is no user, you need a way to circumvent the data source prompt. For this reason, we provide access to the LocateCredentials event.
Within Visual Studio, you can use the API to provide credentials at run time. To use this portion of the API, you must add references to your solution to the following components:
- Data Dynamics Reports Extensibility Library
- Data Dynamics Reports Core
Use the API to provide data credentials on a report at run time. Set up a ReportDefinition and a ReportRuntime, and attach the ReportRuntime to a LocateCredentialsEventHandler as in the sample code below.
LocateCredentials Event Arguments
The reporting engine raises the LocateCredentials event when the data source prompt is disabled, and passes in the following arguments:
The developer provides values for the following arguments:
- UserName (a string)
- Password (a string)
|Note: If you are using Credentials in the Web Report Viewer, then the site should be hosted on a secure site using SSL in order to ensure that the Credentials passed to the report are secure.|