Crystal Reports for Eclipse Developer Guide

Referencing a java class to provide data for a report

When you use a Java class to provide data for a report, you need to specify the class name for the class. For example, with the Java class sample provided, the class name would be JavaBeanConnectivityTest (the class name is specified without the extension). If the class is contained within a package, it is necessary to include the path to the class.
To specify the method in the Java class, specify the table name so that it contains the name of the method. For example:
String tableName = "getCustomerResultSet"
Example: 
The example below creates a new report and adds a table specified by a Java class:
String className = "JavaBeanConnectivityTest";
String tableName = "getCustomerResultSet"
       
try {
	PropertyBag pbConnAttributes = new PropertyBag();
	PropertyBag pbLogonProperties = new PropertyBag();
	TableLinks requiredLink = new TableLinks();

	pbLogonProperties.putStringValue("Java Bean Classes", className);
        
	pbConnAttributes.putStringValue("QE_DatabaseType", "Java Beans Connectivity");
	pbConnAttributes.putStringValue("Database DLL", "crdb_javabeans.dll");
	pbConnAttributes.put("QE_LogonProperties", pbLogonProperties);
	pbConnAttributes.putStringValue("QE_ServerDescription", className);
	pbConnAttributes.putBooleanValue("QE_SQLDB", true);
	
	IProcedure newTable = new Procedure();
	newTable.setName(tableName);
	newTable.getConnectionInfo().setKind(ConnectionInfoKind.CRQE);
	newTable.getConnectionInfo().setAttributes(pbConnAttributes);
	m_ClientDoc.getDatabaseController().addTable(newTable, requiredLink);
}
catch (ReportSDKServerException error) {
    out.println(error.getServerError());
}



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