Creating and initializing database logon information

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.

To create and initialize database logon information
  1. Reference the required Java classes and packages.
  2. <%@ 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" %>

  3. Create an ConnectionInfos object to store the database logon information in.
  4.     ConnectionInfos connInfos = new ConnectionInfos();

  5. Create a ConnectionInfo object for each database logon you want to set.
  6.     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.

  7. Set the database logon information for each ConnectionInfo object.
  8.     connInfo1.setUserName("guest");

        connInfo1.setPassword("password");

  9. Add each ConnectionInfo object to the ConnectionInfos collection.
  10. 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-demand subreports.



Business Objects
http://www.businessobjects.com/
Support services
http://www.businessobjects.com/services/support/