OlapGridObject Class
Represents an OLAP grid object on the report. This class allows you to retrieve information and set generic format options inherited from the ReportObject class.
Namespace CrystalDecisions.CrystalReports.Engine Assembly CrystalDecisions.CrystalReports.Engine (CrystalDecisions.CrystalReports.Engine.dll)
Syntax
'Declaration
Public Class OlapGridObject
Inherits ReportObject
Implements IDisposable
public class OlapGridObject : ReportObject, IDisposable
Remarks
OLAP grid objects are only support in Crystal Reports XI and later. Reports designed with OLAP grids will not open in Crystal Reports for Visual Studio.
Example
This example updates the properties of the OLAP grid object.
'Declaration
Private Sub UpdateOlapGridObjectProperties(ByVal myReportDocument As ReportDocument, ByVal olapGridObjectName As String, ByVal top As Integer, ByVal left As Integer, ByVal height As Integer, ByVal width As Integer)
Dim myReportObject As ReportObject = myReportDocument.ReportDefinition.ReportObjects.Item(olapGridObjectName)
If Not myReportObject Is Nothing And myReportObject.Kind = ReportObjectKind.SubreportObject Then
Dim myOlapGridObject As OlapGridObject = myReportObject
myOlapGridObject.Top = top
myOlapGridObject.Left = left
myOlapGridObject.Height = height
myOlapGridObject.Width = width
Dim myBorder As Border = myOlapGridObject.Border()
myBorder.BackgroundColor = Color.White
myBorder.BorderColor = Color.Red
Dim myObjectFormat As ObjectFormat = myOlapGridObject.ObjectFormat
myObjectFormat.EnableCanGrow = False
myObjectFormat.EnableSuppress = False
myObjectFormat.EnableCloseAtPageBreak = True
myObjectFormat.EnableKeepTogether = True
End If
End Sub
private void UpdateOlapGridObjectProperties(ReportDocument reportDocument, String olapGridObjectName, int top, int left, int height, int width)
{
ReportObject reportObject = reportDocument.ReportDefinition.ReportObjects[olapGridObjectName];
if (reportObject != null && reportObject.Kind == ReportObjectKind.OlapGridObject)
{
OlapGridObject olapGridObject = (OlapGridObject)reportObject;
olapGridObject.Top = top;
olapGridObject.Left = left;
olapGridObject.Height = height;
olapGridObject.Width = width;
Border border = olapGridObject.Border;
border.BackgroundColor = Color.White;
border.BorderColor = Color.Red;
ObjectFormat objectFormat = olapGridObject.ObjectFormat;
objectFormat.EnableCanGrow = false;
objectFormat.EnableSuppress = false;
objectFormat.EnableCloseAtPageBreak = true;
objectFormat.EnableKeepTogether = true;
}
}
Inheritance Hierarchy
Object
EngineObjectBase
ReportObject
OlapGridObject
Version Information
Crystal Reports Basic for Visual Studio 2008
Supported since: Crystal Reports for Visual Studio .NET 2002
See Also
Reference
OlapGridObject Members
CrystalDecisions.CrystalReports.Engine Namespace