To log onto a report database

Parent Previous Next

 

Report Application Server .NET SDK Developer Guide

To log onto a report database


 







One of the simplest ways to programmatically interact with a report's data source is to logon to a report database. The ReportClientDocument object model allows you to submit the logon credentials for any databases that a report connects to instead of forcing the user to do so when they attempt to view the report. The logon method applies the logon credentials to all report database connections, while the LogonEx method will only apply those credentials to a specific database's connections.

  1. Retrieve the DatabaseController object.

Visual Basic

DatabaseController myDatabaseController = rcd.DatabaseController

C#

DatabaseController databaseController = rcd.DatabaseController;

  1. Call the LogonEx method of the DatabaseController class to apply the logon credentials for the report database.

NoteNote

If all the report databases require the same logon credentials, use the logon method and pass in only the user name and password.

Visual Basic

Dim server As String = "<hostname>:<port>"
Dim database As String = "databaseName"
Dim username As String = "UserName"
Dim password As String = "Password"
myDatabaseController.LogonEx(server, database, username, password)

C#

string server = "<hostname>:<port>";
string database = "databaseName";
string username = "UserName";
string password = "Password";
databaseController.LogonEx(server, database, username, password);

The following code sets the logon credentials for all connections in a report database.

Visual Basic

Private Sub DatabaseLogon(ByVal rcd As ISCDReportClientDocument) 
 Dim server As String = "<hostname>:<port>"
 Dim database As String = "databaseName"
 Dim username As String = "UserName"
 Dim password As String = "Password"
 DatabaseController myDatabaseController = rcd.DatabaseController
 myDatabaseController.LogonEx(server, database, username, password)
End Sub

C#

private void DatabaseLogon(ISCDReportClientDocument rcd)
{
 string server = "<hostname>:<port>";
 string database = "databaseName";
 string username = "UserName";
 string password = "Password";
 DatabaseController databaseController = rcd.DatabaseController;
 databaseController.LogonEx(server, database, username, password);
}

This list includes the namespaces used by the sample code:

© 2021 SAP AG. All rights reserved.

http://www.sap.com/sapbusinessobjects/

Support services

http://service.sap.com/bosap-support/

Created with the Personal Edition of HelpNDoc: Easy EPub and documentation editor