ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Reports Namespace / Report Class / AddGroup Method / AddGroup(String,Boolean,Boolean,String,String) Method
The name of the field for the group.
Sort the group field data in ascending order.
Use case sensitive compares when sorting the group field data.
The name of the parent group. If empty, the group will be the topmost group.
The name of the section to add the group.
Example

In This Topic
    AddGroup(String,Boolean,Boolean,String,String) Method
    In This Topic
    Adds a group section to the report. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax

    Parameters

    fieldName
    The name of the field for the group.
    sortAscending
    Sort the group field data in ascending order.
    caseSensitiveSort
    Use case sensitive compares when sorting the group field data.
    parentGroupFieldName
    The name of the parent group. If empty, the group will be the topmost group.
    containerSectionName
    The name of the section to add the group.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    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);
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also