SpreadsheetDocument.Put

Syntax:

Put(<Table>, <Level>, <GroupName>, <IsOpen>)

Parameters:

<Table> (required)

Type: SpreadsheetDocument; SpreadsheetDocumentField.
Table being displayed.

<Level> (optional)

Type: Number.
The level is used to auto-grouping spreadsheet document rows. Adjoining rows with the same level are included to the same group. Rows of the lowest level are not grouped.

<GroupName> (optional)

Type: String.
Name of the group, where belong rows being displayed.
Default value: Empty string.

<IsOpen> (optional)

Type: Boolean.
True - displayed group will be open, False - group will be collapsed.
Default value: True.

Returned value:

Type: SpreadsheetDocumentRange.
The area which received the input.

Description:

Outputs the spreadsheet document into the resulting spreadsheet document. It is added next to the lowest displayed row, from the first column.

Availability:

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

Note:

The property Format of the spreadsheet document cell is not used to format the values displayed using a template.

Example:

Spreadsheet = New SpreadsheetDocument;
Section = Spreadsheet.GetArea("R1");
Section.Area("R1C1").Text = "Number of employees";
Spreadsheet.StartRowAutoGrouping();
Spreadsheet.Put(Section,1,"Group",True);
Total = 0;
For 
H=To Do   
    Value = H; Total = 0;  
    Section.Area("R1C1").Text = "Department "+H;
    Section.Area("R1C2").Text = "";
    Spreadsheet.Put(Section,2,"Group 1",True);
    Section.Area("R1C1").Text = "Group";
    Section.Area("R1C2").Text = "Number";
    Spreadsheet.Put(Section,2,"Group 1",True);
    For 
K=To 10 Do
        Section.Area("R1C1").Text = "A"+H+K;
        Section.Area("R1C2").Text = Value;
        Spreadsheet.Put(Section,3,"Group 2",True);
        Total = Total + Value;
        Value = Value + 10;
    EndDo
;
    Section.Area("R1C1").Text = "Total"+H;
    Section.Area("R1C2").Text = Total;
    Spreadsheet.Put(Section,2,"Group 1",True);
    Section.Area("R1C1:R1C2").Text = "";
    Spreadsheet.Put(Section);
    Total = Total + Total;
EndDo
;
Section.Area("R1C1").Text = "Tota:";
Section.Area("R1C2").Text = Total;
Spreadsheet.Put(Section,1,"Group",True);
Spreadsheet.EndRowAutoGrouping();
Spreadsheet.TotalsBelow = True;
Spreadsheet.ShowGrid = False;
Spreadsheet.Protection = False;
Spreadsheet.ReadOnly = True;
Spreadsheet.Show("Example of using the vertical autogrouping");

See also:

SpreadsheetDocument, method Join

    

1C:Enterprise Developer's Community