ReportDefinition.Sections Property

Gets the Sections collection.

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

Syntax

'Declaration

Public Overrideable ReadOnly Property Sections As CrystalDecisions.CrystalReports.Engine.Sections
public virtual CrystalDecisions.CrystalReports.Engine.Sections Sections {get;}

Example

This example opens the subreport by section.

'Declaration

      Private Sub OpenSubreportBySection(ByVal myReportDocument As ReportDocument)
         Dim myReportDocument2 As ReportDocument
         Dim mySection As Section
         Dim myReportObject As ReportObject
         Dim mySubreportObject As SubreportObject
         For Each mySection In myReportDocument.ReportDefinition.Sections
           For Each myReportObject In mySection.ReportObjects
             If myReportObject.Kind = ReportObjectKind.SubreportObject Then
               mySubreportObject = myReportObject
               myReportDocument2 = mySubreportObject.OpenSubreport(mySubreportObject.SubreportName)
             End If
           Next
         Next
      End Sub
      
      private void OpenSubreportBySection(ReportDocument reportDocument)
      {
         ReportDocument reportDocument2;
         Section section;
         ReportObject reportObject;
         SubreportObject subreportObject;
         for (int i=0; i< reportDocument.ReportDefinition.Sections.Count; i++)
         {
           section = reportDocument.ReportDefinition.Sections[i];
           for (int j=0; j< section.ReportObjects.Count; j++)
           {
             reportObject = section.ReportObjects[j];
             if (reportObject.Kind == ReportObjectKind.SubreportObject)
             {
               subreportObject = (SubreportObject)reportObject;
               reportDocument2 = subreportObject.OpenSubreport(subreportObject.SubreportName);
             }
           }
         }
      }
      

Version Information

Crystal Reports Basic for Visual Studio 2008

Supported since: Crystal Reports for Visual Studio .NET 2002

See Also

Reference

ReportDefinition Class
ReportDefinition Members
CrystalDecisions.CrystalReports.Engine Namespace