BoxObject 類別
代表報表中所繪製的方塊。這個類別可以讓您擷取資訊,並設定繼承自 DrawingObject 類別的泛用格式選項。
如需這個類型所有成員的清單,請參閱 BoxObject 成員。
BoxObject
[Visual Basic]
Public Class BoxObject
Inherits DrawingObject
[C#]
public class BoxObject : DrawingObject
[C++]
__gc public class BoxObject : public DrawingObject
[VJ#]
public class BoxObject extends DrawingObject
註解
透過 ReportObjects 集合的 Item 屬性以索引或名稱來擷取 ReportObject 物件,並轉換 ReportObject 為 BoxObject。
[Visual Basic]
Private Function GetBoxObject _
(ByVal reportObjectName As String) As BoxObject
Dim box As BoxObject
' 依名稱取得 ReportObject,將之轉換為 BoxObject,
' 然後將它傳回來。
If TypeOf _
(Report.ReportDefinition.ReportObjects. _
Item(reportObjectName)) Is BoxObject Then
box = _
Report.ReportDefinition.ReportObjects. _
Item(reportObjectName)
GetBoxObject = box
Else : GetBoxObject = Nothing
End If
End Function
[C#]
private BoxObject GetBoxObject(string reportObjectName)
{
BoxObject box;
// 依名稱取得 ReportObject,將之轉換為 BoxObject,
// 然後將它傳回來。
box =
section.ReportObjects[reportObjectName] as BoxObject;
return box;
}
[C++]
BoxObject* GetBoxObject(String* reportObjectName)
{
BoxObject* box;
// 依名稱取得 ReportObject,將之轉換為 BoxObject,
// 然後將它傳回來。
try
{
box = __try_cast<BoxObject*>
(Report->ReportDefinition->
ReportObjects->Item[reportObjectName]);
return box;
}
catch(System::InvalidCastException*)
{
return 0;
}
};
[VJ#]
private BoxObject GetBoxObject(String reportObjectName)
{
BoxObject box;
// 依名稱取得 ReportObject,將之轉換為 BoxObject,
// 然後將它傳回來。
box = (BoxObject)
section.get_ReportObjects().get_Item(reportObjectName);
return box;
}
需求
命名空間:CrystalDecisions.CrystalReports.Engine
**平台:**Windows 98、Windows NT 4.0、Windows Millennium Edition、Windows 2000
**組件:**CrystalDecisions.Crystalreports.Engine (CrystalDecisions.Crystalreports.Engine.dll)