Crystal Reports for Eclipse Developer Guide

To modify a database field

  1. Use the DatabaseController object to retrieve an instance of the IDatabase object.
      DatabaseController databaseController = clientDoc.getDatabaseController(); 
      IDatabase database = databaseController.getDatabase();
    
  2. Get the first table in the report.
      Tables tables = database.getTables(); 
      ITable table = (Table)tables.getTable(0);
    
  3. Gets the field in the Fields collection specified by the field name.
      Fields fields = table.getDataFields(); 
      IField field = (Field)fields.findField("{Customer.Region}", 
      FieldDisplayNameType.fieldName, java.util.Locale.CANADA);
    
    
Example: 
void ModifyDatabaseField(ReportClientDocument clientDoc)
{
  DatabaseController databaseController = clientDoc.getDatabaseController(); 
  IDatabase database = databaseController.getDatabase();
 
  Tables tables = database.getTables(); 
  ITable table = (Table)tables.getTable(0);

  Fields fields = table.getDataFields(); 
  IField field = (Field)fields.findField("{Customer.Region}",
  FieldDisplayNameType.fieldName, java.util.Locale.CANADA);

}

Note: You can use the DataDefController.findFieldByFormulaForm method to find a field by specifying the formula form.



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