GroupNameFieldDefinition Class
Provides properties for retrieving information on a group name field found in a report.
Namespace CrystalDecisions.CrystalReports.Engine Assembly CrystalDecisions.CrystalReports.Engine (CrystalDecisions.CrystalReports.Engine.dll)
Syntax
'Declaration
Public Class GroupNameFieldDefinition
Inherits FieldDefinition
Implements IDisposable
public class GroupNameFieldDefinition : FieldDefinition, IDisposable
Remarks
Retrieve a GroupNameFieldDefinition object by index or by name through the Item Property of the GroupNameFieldDefinitions collection.
Example
This example verifies that a Group Name field's datasource contains the Last Name field from the Customer table.
'Declaration
Private Function VerifyGroupNameFieldObjectDataSource(ByVal myReportDocument As ReportDocument, ByVal reportObjectName As String) As Boolean
Dim results As Boolean = False
Dim myReportObject As ReportObject = myReportDocument.ReportDefinition.ReportObjects.Item(reportObjectName)
If myReportObject.Kind = ReportObjectKind.FieldObject Then
Dim myFieldObject As FieldObject = myReportObject
Dim myDatabaseGroupNameFieldDefinition As GroupNameFieldDefinition = myFieldObject.DataSource
results = (myDatabaseGroupNameFieldDefinition.Kind = FieldKind.FormulaField) And _
(myDatabaseGroupNameFieldDefinition.ValueType = FieldValueType.StringField) And _
(myDatabaseGroupNameFieldDefinition.Name = "Last Name") And _
Not (myDatabaseGroupNameFieldDefinition.Group Is Nothing) And _
(myDatabaseGroupNameFieldDefinition.GroupNameFieldName.Length > 0) And _
(myDatabaseGroupNameFieldDefinition.NumberOfBytes = 16) And _
(myDatabaseGroupNameFieldDefinition.FormulaName = "")
End If
VerifyGroupNameFieldObjectDataSource = results
End Function
private bool VerifyGroupNameFieldObjectDataSource(ReportDocument reportDocument, String reportObjectName )
{
bool results = false;
ReportObject reportObject = reportDocument.ReportDefinition.ReportObjects[reportObjectName];
if (reportObject.Kind == ReportObjectKind.FieldObject)
{
FieldObject fieldObject = (FieldObject)reportObject;
GroupNameFieldDefinition databaseGroupNameFieldDefinition =
(GroupNameFieldDefinition)fieldObject.DataSource;
results = ((databaseGroupNameFieldDefinition.Kind == FieldKind.FormulaField) &&
(databaseGroupNameFieldDefinition.ValueType == FieldValueType.StringField) &&
(databaseGroupNameFieldDefinition.Name == "Last Name") &&
(databaseGroupNameFieldDefinition.Group != null) &&
(databaseGroupNameFieldDefinition.GroupNameFieldName.Length > 0) &&
(databaseGroupNameFieldDefinition.NumberOfBytes == 16) &&
(databaseGroupNameFieldDefinition.FormulaName == ""));
}
return results;
}
Inheritance Hierarchy
Object
EngineObjectBase
FieldDefinition
GroupNameFieldDefinition
Version Information
Crystal Reports Basic for Visual Studio 2008
Supported since: Crystal Reports for Visual Studio .NET 2002
See Also
Reference
GroupNameFieldDefinition Members
CrystalDecisions.CrystalReports.Engine Namespace