SpecialVarFieldDefinition 类

提供属性以检索报表中的特殊字段的信息。

有关该类型所有成员的列表,参见 SpecialVarFieldDefinition 成员。

System.Object
   CrystalDecisions.CrystalReports.Engine.EngineObjectBase
      CrystalDecisions.CrystalReports.Engine.FieldDefinition
         SpecialVarFieldDefinition

[Visual Basic]

Public Class SpecialVarFieldDefinition
Inherits FieldDefinition
Implements IDisposable

[C#]

public class SpecialVarFieldDefinition : FieldDefinition, IDisposable

备注

通过 FieldObject 对象的 DataSource 属性,检索 FieldDefinition 对象,并将 FieldDefinition 对象转换为 SpecialVarFieldDefinition 对象。

示例

下面示例返回 SpecialVarFieldDefinition 对象。

  
[VJ#]
      private SpecialVarFieldDefinition getSpecialField
         (String reportObjectName) 
      {
         FieldObject field;
         SpecialVarFieldDefinition specialField = null;
      
         try
         {
            field = (FieldObject)Report.get_ReportDefinition()
               .get_ReportObjects().get_Item( reportObjectName );
            specialField = 
               (SpecialVarFieldDefinition)field.get_DataSource();
         }
         catch (Exception e)
         {
         }
         return specialField;
      }
      
  
[Visual Basic]
      Private Function GetSpecialField _
         (ByVal reportObjectName As String) As SpecialVarFieldDefinition
         Dim field As FieldObject
         Dim specialField As SpecialVarFieldDefinition
      
         If TypeOf _
            (Report.ReportDefinition.ReportObjects. _ 
            Item(reportObjectName)) Is FieldObject Then
            field = Report.ReportDefinition.ReportObjects. _
               Item(reportObjectName)
      
            If TypeOf (field.DataSource) _ 
               Is SpecialVarFieldDefinition Then
               specialField = field.DataSource
               GetSpecialField = specialField
            Else : GetSpecialField = Nothing
            End If
         Else : Return Nothing
         End If
      End Function
      
  
[C#]
      private SpecialVarFieldDefinition GetSpecialField
         (string reportObjectName) 
      {
         FieldObject field;
         SpecialVarFieldDefinition specialField;
      
         field = 
            Report.ReportDefinition.ReportObjects[reportObjectName]
            as FieldObject;
         if (field != null)
         {
            specialField = field.DataSource as 
               SpecialVarFieldDefinition;
            if(specialField != null) return specialField;
            else return null;
         }
         else return null;
      }
      

要求

命名空间 CrystalDecisions.CrystalReports.Engine

程序集 CrystalDecisions.CrystalReports.Engine (CrystalDecisions.CrystalReports.Engine.dll)

请参见

SpecialVarFieldDefinition 成员 | CrystalDecisions.CrystalReports.Engine 命名空间

**

©2005 Business Objects SA 保留所有权利。

Business Objects SA
http://www.china.businessobjects.com/
支持服务
http://www.china.businessobjects.com/