Set Cell Style

PUT /api/spreadsheet/setcellstyle

Input example (JSON)

{
"id": "some_id",
"filename": "test",
"extension": "xls",
"sheetindex": 0,
"sheetname": "Sheet1",
"columnindex": 1,
"rowindex": 2,
"alignment": {
"horizontalalignment": "Left",
"verticalalignment": "Center",
"wraptext": false,
"textrotation": 0
},
"fill": {
"backgroundcolor": {
"A": 255,
"R": 8,
"G": 133,
"B": 161
},
"foregroundcolor": {
"A": 255,
"R": 243,
"G": 243,
"B": 242
},
"patterntype": "LightVertical",
"filltype": "Gradient"
},
"border": {
"bottomlinestyle": "Double",
"bottomlinecolor": {
"A": 100,
"R": 243,
"G": 243,
"B": 242
},
"toplinestyle": "Double",
"toplinecolor": {
"A": 100,
"R": 243,
"G": 243,
"B": 242
},
"leftlinestyle": "Thick",
"leftlinecolor": {
"A": 100,
"R": 243,
"G": 243,
"B": 242
},
"rightlinestyle": "Thick",
"rightlinecolor": {
"A": 100,
"R": 243,
"G": 243,
"B": 242
},
"diagonaluplinestyle": "Thin",
"diagonaldownlinestyle": "Thin",
"diagonalcolor": {
"A": 100,
"R": 243,
"G": 243,
"B": 242
},
"outline": false
},
"font": {
"fontsize": 15,
"name": "Arial",
"fontcolor": {
"A": 150,
"R": 243,
"G": 243,
"B": 242
},
"bold": false,
"italic": true,
"strikethrough": false,
"underline": "Single"
},
"autofit": false,
"formatstring": "(###) ###-####"
}

Description: Applies the specified style to a cell.

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 the cell belongs.

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

  • sheetindex - a zero-based index of the worksheet to which the cell belongs.

  • sheetname - a string value specifying a name of the worksheet to which the cell belongs.

  • columnindex - a zero-based index of the column to which the cell belongs.

  • rowindex - a zero-based index of the row to which the cell belongs.

  • alignment - an object that specifies how cell content is aligned.

  • fill - an object that specifies the cell's background and foreground colors, text effects, and etc.

  • border - an object that specifies the cell border's attributes.

  • font - an object that specifies the cell font.

  • autofit - a boolean value that specifies whether or not cell size is automatically changed to fit the contents.

  • formatstring - a string value that specifies the cell contents format string.