ActiveReports 19 .NET Edition
MESCIUS.ActiveReports.Design.Win Assembly / GrapeCity.ActiveReports.Design Namespace / Designer Class / LocateCredentials Event
Example

In This Topic
    LocateCredentials Event (Designer)
    In This Topic
    Occurs when the report is previewed and credentials are needed.
    Syntax
    'Declaration
     
    Public Event LocateCredentials As LocateCredentialsEventHandler
    public event LocateCredentialsEventHandler LocateCredentials
    Event Data

    The event handler receives an argument of type LocateCredentialsEventArgs containing data related to this event. The following LocateCredentialsEventArgs properties provide information specific to this event.

    PropertyDescription
    Gets the data source to locate credentials for.  
    Gets ot sets the password of the credentials to be located.  
    Gets the text of prompt of the locate credentials request.  
    Gets the name of the report to locate credentials for.  
    Gets ot sets the user name of the credentials to be located.  
    Remarks
    This event is raised when accessing a data source requires authentication, and credentials are not available or need to be confirmed. It provides a secure way to request and apply credentials without hard-coding them into the report or application.

    Handlers for this event can prompt the user for credentials, retrieve them from a secure store, or apply default credentials based on application logic.

    Example
    It can be necessary for report preview. Use this event to provide the credentials for the data providers.
    designer.LocateCredentials += (sender, args) => {
    	args.UserName = "sa";
    	args.Password = "12345";
    }
    See Also