Crystal Reports for Eclipse Developer Guide

To log onto a report database

One of the most basic ways you can programmatically interact with a report's data source is to logon to a report database. The ReportClientDocument object model allows you to submit the required 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 and logonEx methods will apply the logon credentials to all connections in the report, without forcing you to individually set each table's connection.
Use these methods when you only want to change the logon credentials or database location, and not the type of data source or additional connection properties.
  1. Retrieve the DatabaseController object.
    DatabaseController databaseController = rcd.getDatabaseController();
  2. Call the logonEx method of the database controller to apply the logon credentials for the report database.
    String server = "Xtreme Sample Database 2005";
    String database = "Xtreme Sample Database 2005";
    String username = "username";
    String password = "password";
    databaseController.logonEx(server, database, username, password);
Example: 
The following code sets the logon credentials for all connections in a report.
void logonDatabase(ReportClientDocument rcd)
{
	 String server = "Xtreme Sample Database 2005";
  String database = "Xtreme Sample Database 2005";
  String username = "username";
  String password = "password";  

  DatabaseController databaseController = rcd.getDatabaseController();
  databaseController.logonEx(server, database, username, password);
}



SAP BusinessObjects
http://www.sap.com/sapbusinessobjects/
Support services
http://service.sap.com/bosap-support/
Product Documentation on the Web
http://help.sap.com/