Database logon information is stored in a ConnectionInfo object. The ConnectionInfo object is then added to a ConnectionInfos collection object. This allows more than one database logon to be added, providing support for subreports with different database connections.
ConnectionInfos connInfos = new ConnectionInfos();
IConnectionInfo connInfo1 = new ConnectionInfo();
IConnectionInfo connInfo2 = new ConnectionInfo();
Note: The interface is used to manipulate the ConnectionInfo object, as it simplifies the methods available and allows for future support of different types of ConnectionInfo objects.
In this case, a generic guest account is used for each.
connInfo1.setUserName("guest");
connInfo1.setPassword("password");
connInfo2.setUserName("guest");
connInfo2.setPassword("password");
The ConnectionInfos object can now be used to set the database logon information for a report.
Note: If only one ConnectionInfo object is added to the ConnectionInfos collection, then the user name and password stored in that ConnectionInfo object is applied to all connections, including embedded subreports and on
| Crystal Decisions http://www.crystaldecisions.com/ Support services http://support.crystaldecisions.com/ |