SpreadsheetDocument.InsertArea

Syntax:

InsertArea(<SourceArea>, <ReceivingArea>, <Move>, <FillParameters>)

Parameters:

<SourceArea> (required)

Type: SpreadsheetDocumentRange.
Source area.

<ReceivingArea> (optional)

Type: SpreadsheetDocumentRange.
Receiving area. If parameter is not specified, area is inserted to the right of source area (with taking into account of shift).

<Move> (optional)

Type: SpreadsheetDocumentShiftType.
Defines table cells offset when inserting. It has sense only for rectangular area of cells.
For rows/columns areas with any parameter value other than WithoutShift the offset will be vertical or horizontal respectively.
Default value: WithoutShift.

<FillParameters> (optional)

Type: Boolean.
Whether it is necessary to fill parameters by their values.
In case of parameter's value is not set, primary cells' parameters' names will be placed in resulting cells' text.
Default value: True.

Description:

Inserts a copy of the spreadsheet document source area into the receiving area.

Availability:

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

Note:

An error will occur by this method of execution if the source area size does not match target area size.
The property Format of the spreadsheet document cell is not used to format any values displayed using a template.

Example:

Spreadsheet = New SpreadsheetDocument;
Total = 0;
For 
K=To 10 Do
    Spreadsheet.Area("R"+(K+1)+"C1").Text = "String "+K;
    Spreadsheet.Area("R"+(K+1)+"C2").Text = K*10;
    Total = Total+K*10;
EndDo
;
Spreadsheet.InsertArea(Spreadsheet.Area("R2"), Spreadsheet.Area("R3"), 
        SpreadsheetDocumentShiftType.Horizontal);
Spreadsheet.Area("R2C1").Text = "Total:";
Spreadsheet.Area("R2C2").Text = Total;
Border = New Line(SpreadsheetDocumentCellLineType.Solid, 1);
Spreadsheet.Area("R2C1:R2C2").Outline(,Border,,Border); 
Spreadsheet.ShowGrid = False;
Spreadsheet.Protection = False;
Spreadsheet.ReadOnly = True;
Spreadsheet.Show("Example of using the InsertArea() method.");

See also:

SpreadsheetDocument, method DeleteArea

    

1C:Enterprise Developer's Community