ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Reports Namespace / Report Class / RemoveGroups Method / RemoveGroups(IEnumerable<String>,IEnumerable<String>) Method
The array of group field names.
The array of section names containing group.
Example

In This Topic
    RemoveGroups(IEnumerable<String>,IEnumerable<String>) Method
    In This Topic
    Removes the group from the report. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax

    Parameters

    groupFieldNames
    The array of group field names.
    parentSectionNames
    The array of section names containing group.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    The report does not have a valid report section.
    The group field names must be associated by a header and footer section.
    Example
    Modify the Report DefinitionQuery
    //Note: Call within QueuedTask.Run()
    //Remove Groups
    // The fields in the datasource used for the report
    var listFields = new List<string> {
           "STATE_NAME"
          };
    report.RemoveGroups(listFields);
    
    //Add Group
    report.AddGroup("STATE_NAME", true, true, "");
    
    //Modify the Definition Query
    var defQuery = "STATE_NAME LIKE 'C%'";
    report.SetDefinitionQuery(defQuery);
    Modify the Report DefinitionQuery
    //Note: Call within QueuedTask.Run()
    //Remove Groups
    // The fields in the datasource used for the report
    var listFields = new List<string> {
           "STATE_NAME"
          };
    report.RemoveGroups(listFields);
    
    //Add Group
    report.AddGroup("STATE_NAME", true, true, "");
    
    //Modify the Definition Query
    var defQuery = "STATE_NAME LIKE 'C%'";
    report.SetDefinitionQuery(defQuery);
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also