Share via


CrossTabObject Class

Represents a cross-tab object on the report.

Namespace CrystalDecisions.CrystalReports.Engine Assembly CrystalDecisions.CrystalReports.Engine (CrystalDecisions.CrystalReports.Engine.dll)

Syntax

'Declaration
Public Class CrossTabObject
    Inherits ReportObject
    Implements IDisposable
public class CrossTabObject : ReportObject, IDisposable

Remarks

This class allows you to retrieve information and set generic format options inherited from the ReportObject class.

Example

This example updates the properties of a cross tab object.

'Declaration

          Private Sub UpdateCrossTabObjectProperties(ByVal myReportDocument As ReportDocument, ByVal crossTabChartName 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(crossTabChartName)
            If Not myReportObject Is Nothing And myReportObject.Kind = ReportObjectKind.CrossTabObject Then
              Dim myCrossTabObject As ChartObject = myReportObject
              myCrossTabObject.Top = top
              myCrossTabObject.Left = left
              myCrossTabObject.Height = height
              myCrossTabObject.Width = width

          Dim myBorder As Border = myCrossTabObject.Border()
              myBorder.BackgroundColor = Color.White
              myBorder.BorderColor = Color.Red

              Dim myObjectFormat As ObjectFormat = myCrossTabObject.ObjectFormat
              myObjectFormat.EnableCanGrow = False
              myObjectFormat.EnableSuppress = False
              myObjectFormat.EnableCloseAtPageBreak = True
              myObjectFormat.EnableKeepTogether = True
            End If
          End Sub
          
          private void UpdateCrossTabObjectProperties(ReportDocument reportDocument, String crossTabObjectName, int top, int left, int height, int width)
          {
            ReportObject reportObject = reportDocument.ReportDefinition.ReportObjects[crossTabObjectName];
            if (reportObject != null && reportObject.Kind == ReportObjectKind.CrossTabObject)
            {
              CrossTabObject crossTabObject = (CrossTabObject)reportObject;
              crossTabObject.Top = top;
              crossTabObject.Left = left;
              crossTabObject.Height = height;
              crossTabObject.Width = width;

              Border border = crossTabObject.Border;
              border.BackgroundColor = Color.White;
              border.BorderColor = Color.Red;

              ObjectFormat objectFormat = crossTabObject.ObjectFormat;
              objectFormat.EnableCanGrow = false;
              objectFormat.EnableSuppress = false;
              objectFormat.EnableCloseAtPageBreak = true;
              objectFormat.EnableKeepTogether = true;
            }
          }
          

Inheritance Hierarchy

Object
   EngineObjectBase
      ReportObject
         CrossTabObject

Version Information

Crystal Reports Basic for Visual Studio 2008

Supported since: Crystal Reports for Visual Studio .NET 2002

See Also

Reference

CrossTabObject Members
CrystalDecisions.CrystalReports.Engine Namespace