SpreadsheetDocument.StartRowGroup

Syntax:

StartRowGroup(<GroupName>, <WhetherGroupIsOpen>)

Parameters:

<GroupName> (optional)

Type: String.
Group name.

<WhetherGroupIsOpen> (optional)

Type: Boolean.
You can use it to define if it is necessary to open a group. True - an outputted group will be opened, False - a group will be outputted in a collapsed view.
Default value: True.

Description:

New rows group is started. You can create nested rows groups.

Availability:

Server, thick client, external connection, Mobile application (server).

Example:

Spreadsheet = New SpreadsheetDocument;
Section = Spreadsheet.GetArea("R1");
Section.Area("R1C1").Text = "Number of employees";
Spreadsheet.Put(Section);
Spreadsheet.StartRowGroup("By all departments", True);
All = 0;
For 
H=To Do   
    Value = H; Total = 0;  
    Section.Area("R1C1").Text = "Department "+H;
    Section.Area("R1C2").Text = "";
    Spreadsheet.Put(Section);
    Spreadsheet.StartRowGroup("Department"+H, True);
    Section.Area("R1C1").Text = "Group";
    Section.Area("R1C2").Text = "Number";
    Section.Area("R1C2").HorizontalAlign = 
        HorizontalAlign.Auto;
    Spreadsheet.Put(Section);
    Spreadsheet.StartRowGroup("Group "+H, True);
    For 
K=To Do
        Section.Area("R1C1").Text = "A"+H+K;
        Section.Area("R1C2").Text = Value;
        Spreadsheet.Put(Section);
        Total = Total + Value;
        Value = Value + 10;
    EndDo
;
    Spreadsheet.EndRowGroup(); // end the "Group" group
    Spreadsheet.EndRowGroup(); // end the "Department" group
    Section.Area("R1C1").Text = "Total"+H;
    Section.Area("R1C2").Text = Total;
    Spreadsheet.Put(Section);
    Section.Area("R1C1:R1C2").Text = "";
    Spreadsheet.Put(Section);
    All = All + Total;
EndDo
;
Spreadsheet.EndRowGroup(); // end the "By all departments" group
Section.Area("R1C1").Text = "Total:";
Section.Area("R1C2").Text = All;
Spreadsheet.Put(Section);
Spreadsheet.TotalsBelow = False;
Spreadsheet.ShowGrid = False;
Spreadsheet.Protection = False;
Spreadsheet.ReadOnly = True;
Spreadsheet.Show("Example of using the StartRowGroup() method");

See also:

SpreadsheetDocument, method EndRowGroup

    

1C:Enterprise Developer's Community