共用方式為


CrossTabObject 類別

代表報表中的交叉表物件。這個類別可以讓您擷取資訊,並設定繼承自 ReportObject 類別的泛用格式選項。

如需這個類型所有成員的清單,請參閱 CrossTabObject 成員

Object

   ReportObject

      CrossTabObject

[Visual Basic]

Public Class CrossTabObject
   Inherits ReportObject

[C#]

public class CrossTabObject : ReportObject

[C++]

__gc public class CrossTabObject : public ReportObject

[VJ#]

public class CrossTabObject extends ReportObject

註解

透過 ReportObjects 集合的 Item 屬性以索引或名稱來擷取 ReportObject 物件,並將 ReportObject 轉換 CrossTabObject

範例

下列範例會傳回 CrossTabObject 物件。

[Visual Basic]

Private Function GetCrossTabObject _ 
(ByVal reportObjectName As String) As CrossTabObject
   Dim crossTab As CrossTabObject

   ' 依名稱取得 ReportObject,將之轉換為 CrossTabObject,
   '  然後將它傳回來。
   If TypeOf _
   (Report.ReportDefinition.ReportObjects. _ 
   Item(reportObjectName)) Is CrossTabObject Then
      crossTab = _ 
      Report.ReportDefinition.ReportObjects. _ 
      Item(reportObjectName)
      GetCrossTabObject = crossTab
   Else : GetCrossTabObject = Nothing
   End If
End Function

[C#]

private CrossTabObject GetCrossTabObject(string reportObjectName)
{
   CrossTabObject crossTab;

   // 依名稱取得 ReportObject,將之轉換為 
   //  CrossTabObject,然後將它傳回來。
   crossTab = 
   Report.ReportDefinition.ReportObjects[reportObjectName] 
   as CrossTabObject;
   if (crossTab != null) return crossTab;
   else return null;
}

[C++]

CrossTabObject* GetCrossTabObject(String* reportObjectName)
{
   CrossTabObject* crossTab;

   // 依名稱取得 ReportObject,將之轉換為 CrossTabObject,
   //  然後將它傳回來。
   try
   {
      crossTab = __try_cast<CrossTabObject*>
      (Report->ReportDefinition->
      ReportObjects->Item[reportObjectName]);
      return crossTab;
   }
   catch(System::InvalidCastException*)
   {
      return 0;
   }
};

[VJ#]

private CrossTabObject GetCrossTabObject(String reportObjectName)
{
   CrossTabObject crossTab;

   // 依名稱取得 ReportObject,將之轉換為 
   //  CrossTabObject,然後將它傳回來。
   crossTab = (CrossTabObject)
   Report.get_ReportDefinition().get_ReportObjects().get_Item(reportObjectName);
   if (crossTab != null) return crossTab;
   else return null;
}

需求

命名空間CrystalDecisions.CrystalReports.Engine

**平台:**Windows 98、Windows NT 4.0、Windows Millennium Edition、Windows 2000

**組件:**CrystalDecisions.Crystalreports.Engine (CrystalDecisions.Crystalreports.Engine.dll)

請參閱

CrossTabObject 成員 | CrystalDecisions.CrystalReports.Engine 命名空間