Database logon information is stored in a ConnectionInfo object. The ConnectionInfo object is then added to a ConnectionInfos object. This allows more than one database logon to be added, providing support for subreports with different database connections.
<%@ page import="com.crystaldecisions.report.web.viewer.*" %>
<%@ page import="com.crystaldecisions.sdk.occa.report.data.*" %>
<%@ page import="com.crystaldecisions.reports.reportengineinterface.JPEReportSourceFactory" %>
<%@ page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSourceFactory2" %>
ConnectionInfos connInfos = new ConnectionInfos();
IConnectionInfo connInfo1 = 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.
connInfo1.setUserName("guest");
connInfo1.setPassword("password");
The ConnectionInfos object can now be used to set the database logon information for a report.
connInfos.add(connInfo1);
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
Business Objects http://www.businessobjects.com/ Support services http://www.businessobjects.com/services/support/ |