Insert/Delete Cells

PUT /api/spreadsheet/insertcells

Input example (JSON)

{
"id": "some_id",
"filename": "test",
"extension": "xls",
"sheetindex": 0,
"sheetname": "Sheet1",
"startrowindex": 0,
"startcolumnindex": 0,
"endrowindex": 3,
"endcolumnindex": 5,
"mode": "ShiftCellsDown",
"formatmode": "FormatAsPrevious"
}

Description: Inserts new cells into the worksheet according to the specified parameters. You can specify inserted cells by either row and column start/end indexes, or by the cell range (for example, "A1: C5").

JSON fields

  • id - an identifier of a session to which the document has been loaded. This parameter's value is returned by the request used to create or load the document.

  • filename - a string value that specifies the file name of the document to which cells belong.

  • extension - a string value that specifies the file extension of the document to which cells belong. The supported file extensions are: OPENXML (XLSX), XLS and CSV.

  • sheetindex - a zero-based index of the worksheet.

  • sheetname - a string value that specifies the worksheet name.

  • startrowindex - a zero-based index of a row below which cells will be inserted.

  • startcolumnindex - a zero-based index of a column on the right of which cells will be inserted.

  • endrowindex - a zero-based index of a row above which cells will be inserted.

  • endcolumnindex - a zero-based index of a column to the left of which cells will be inserted.

  • range - an object that specifies the cell range where new cells will be inserted.

  • mode - specifies how to insert new cells into the worksheet. Available modes are:

    1. EntireColumn - entire columns are inserted to the left of the specified cells

    2. EntireRow - entire rows are inserted above the specified cells

    3. ShiftCellsDown - when inserting new cells into a worksheet, other cells in the same column are shifted down

    4. ShiftCellsRight - when inserting new cells into a worksheet, other cells in the same row are shifted to the right

  • format mode - specifies how new cells will be formated. Available format modes are:

    1. FormatAsPrevious - inserted cells are formated like the "previous" cell; if cells are inserted with the "ShiftCellsDown" mode, the previous cell is the cell located above the inserted cells; if cells are inserted with the "ShiftCellsRight" mode, the previous cell is the cell located on the left of the inserted cells

    2. FormatAsNext - inserted cells are formated like the "next" cell; if cells are inserted with the "ShiftCellsDown" mode, the next cell is the cell located below the inserted cells; if cells are inserted with the "ShiftCellsRight" mode, the next cell is the cell located on the right of the inserted cells

    3. ClearFormat - inserted cells are not formated


DELETE /api/spreadsheet/deletecells

Input example (JSON)

{
"id": "some_id",
"filename": "test",
"extension": "xls",
"sheetindex": 0,
"sheetname": "Sheet1",
"startrowindex": 0,
"startcolumnindex": 0,
"endrowindex": 3,
"endcolumnindex": 5,
"mode": "ShiftCellsLeft"
}

Description: Deletes cells from the worksheet according to the specified parameters. You can specify deleted cells by either row and column start/end indexes, or by the cell range (for example, "A1: C5").

JSON fields

  • id - an identifier of a session to which the document has been loaded. This parameter's value is returned by the request used to create or load the document.

  • filename - a string value that specifies the file name of the document, to which cells belong.

  • extension - a string value that specifies the file extension of the document to which cells belong. The supported file extensions are: OPENXML (XLSX), XLS and CSV.

  • sheetindex - a zero-based index of the worksheet.

  • sheetname - a name of the worksheet.

  • startrowindex - a zero-based index of a row below which cells will be deleted.

  • startcolumnindex - a zero-based index of a column on the right of which cells will be deleted.

  • endrowindex - a zero-based index of a row until which cells will be deleted.

  • endcolumnindex - a zero-based index of a column to the left of which cells will be deleted.

  • range - an object that specifies the cell range from which cells will be deleted.

  • mode - specifies how to delete cells from the worksheet. Available modes are:

    1. EntireColumn - entire columns containing the specified cell range are deleted

    2. EntireRow - entire rows containing the specified cell range are deleted

    3. ShiftCellsLeft - when deleting cells from a worksheet, other cells in the same row are shifted to the left

    4. ShiftCellsUp - when deleting cells from a worksheet, other cells in the same column are shifted up