ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Reports Namespace / Report Class / Elements Property
Example

In This Topic
    Elements Property (Report)
    In This Topic
    Gets the collection of elements in the report.
    Syntax
    Example
    Zoom to specific location on Report view
    {
      await QueuedTask.Run(() =>
      {
        var detailsSection = report.Elements.OfType<ReportSection>().FirstOrDefault().Elements.OfType<ReportDetails>().FirstOrDefault();
        var bounds = detailsSection.GetBounds();
        ReportView.Active.ZoomTo(bounds);
      });
    }
    Get various Report sections
    {
      //Get the "ReportSection element"
      //ReportSectionElement contains the ReportHeader, ReportPageHeader, ReportDetails. ReportPageFooter, ReportFooter sections.
      var mainReportSection = report.Elements.OfType<ReportSection>().FirstOrDefault();
    
      //Get the ReportHeader
      var reportHeader = mainReportSection?.Elements.OfType<ReportHeader>().FirstOrDefault();
    
      //Get the ReportHeader
      var reportPageHeader = mainReportSection?.Elements.OfType<ReportPageHeader>().FirstOrDefault();
    
      //Get the "ReportDetails" within the ReportSectionElement. ReportDetails is where "fields" are.
      var reportDetailsSection = mainReportSection?.Elements.OfType<ReportDetails>().FirstOrDefault();
    
      //Get the ReportPageFooter
      var reportPageFooter = mainReportSection?.Elements.OfType<ReportPageFooter>().FirstOrDefault();
    
      //Get the ReportFooter
      var reportFooter = mainReportSection?.Elements.OfType<ReportFooter>().FirstOrDefault();
    }
    Select all elements
    {
      //Select all elements in the Report Footer.
      ReportPageFooter pageFooterSection = report.Elements.OfType<ReportSection>().FirstOrDefault().Elements.OfType<ReportPageFooter>().FirstOrDefault();
      pageFooterSection.SelectAllElements();
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also