SpreadsheetDocument.StartRowGroup
Syntax:
Parameters:
<GroupName> (optional)
Group name.
<WhetherGroupIsOpen> (optional)
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:
Availability:
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=1 To 3 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=1 To 4 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: