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