ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Reports Namespace / ReportView Class / SelectElements Method
A list of existing report elements. If null then all elements are unselected.
Example

In This Topic
    SelectElements Method (ReportView)
    In This Topic
    Set the selected report elements for the report view.
    Syntax
    Public Sub SelectElements( _
       ByVal elements As IReadOnlyList(Of Element) _
    ) 
    public void SelectElements( 
       IReadOnlyList<Element> elements
    )

    Parameters

    elements
    A list of existing report elements. If null then all elements are unselected.
    Remarks
    If a child of a group element is provided in the list of elements to be selected in addition to its parent then the parent is the element selected. In addition if multiple section elements are in the list of elements, then only the first section element is selected.
    Example
    Select elements
    {
      //Get the "ReportSection element"
      //ReportSectionElement contains the ReportHeader, ReportPageHeader, ReportDetails. ReportPageFooter, ReportFooter sections.
      var mainReportSection = report.Elements.OfType<ReportSection>().FirstOrDefault();
    
      //ReportDetailsSection contains the "Fields"
      //Get the "ReportDetails" within the ReportSectionElement. ReportDetails is where "fields" are.
      var reportDetailsSection = mainReportSection?.Elements.OfType<ReportDetails>().FirstOrDefault();
    
      var elements = reportDetailsSection.Elements;
      reportDetailsSection.SelectElements(elements);
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also