Spread.Sheets Documentation
Worksheet Method
The name of the Worksheet.
Represents a worksheet.
Syntax
var value; // Type: any
value = GC.Spread.Sheets.Worksheet(name);
function Worksheet( 
   name : string
) : any;

Parameters

name
The name of the Worksheet.

Return Value

The following values can be returned:

options.color

string type

Specifies the color of the grid line.

options.showVerticalGridline

boolean type

Specifies whether to display the vertical grid line.

options.showHorizontalGridline

boolean type

Specifies whether to display the horizontal grid line.

Example
The following examples use the Worksheet options.
activeSheet.setRowCount(2,GC.Spread.Sheets.SheetArea.colHeader);
activeSheet.setColumnCount(2,GC.Spread.Sheets.SheetArea.rowHeader);
activeSheet.setValue(0, 2,"Column",GC.Spread.Sheets.SheetArea.colHeader);
activeSheet.options.rowHeaderAutoTextIndex = 1;
activeSheet.options.rowHeaderAutoText = GC.Spread.Sheets.HeaderAutoText.letters;
activeSheet.options.colHeaderAutoTextIndex = 1;
activeSheet.options.colHeaderAutoText = GC.Spread.Sheets.HeaderAutoText.numbers;
var htext = activeSheet.options.colHeaderAutoText;
var hindex = activeSheet.options.colHeaderAutoTextIndex;
var hvisible = activeSheet.options.colHeaderVisible;
alert(htext);
alert(hindex);
alert(hvisible);
sheet.options.gridline = {color:"#FF2235", showVerticalGridline: true, showHorizontalGridline: false};
sheet.resumePaint();
sheet.repaint();
sheet.getCell(1,1, GC.Spread.Sheets.SheetArea.viewport).locked(false);
sheet.setValue(1,1,"unLocked");
sheet.getRange(-1,3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).locked(false);
sheet.getRange(5, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).locked(false);
sheet.options.isProtected = true;
sheet.setRowCount(2,GC.Spread.Sheets.SheetArea.colHeader);
sheet.setColumnCount(2,GC.Spread.Sheets.SheetArea.rowHeader);
sheet.setValue(0, 2,"Column",GC.Spread.Sheets.SheetArea.colHeader);
sheet.options.rowHeaderAutoTextIndex = 1;
sheet.options.colHeaderAutoText = GC.Spread.Sheets.HeaderAutoText.letters;
sheet.options.rowHeaderVisible = false;
spread.setSheetCount(3);
spread.startSheetIndex(0);
spread.getSheet(0).options.sheetTabColor = "red";
spread.getSheet(1).options.sheetTabColor = "#FFFF00";
spread.getSheet(2).options.sheetTabColor = "Accent 4";
sheet.options.colHeaderVisible = false;
sheet.setRowCount(2,GC.Spread.Sheets.SheetArea.colHeader);
sheet.setColumnCount(2,GC.Spread.Sheets.SheetArea.rowHeader);
sheet.setValue(0, 2,"Column",GC.Spread.Sheets.SheetArea.colHeader);
sheet.options.colHeaderAutoTextIndex = 1;
sheet.options.colHeaderAutoText = GC.Spread.Sheets.HeaderAutoText.numbers;
activeSheet.frozenRowCount(1);
activeSheet.frozenColumnCount(1);
activeSheet.options.frozenlineColor = "red";
sheet.options.allowCellOverflow = true;
sheet.getCell(0,3, GC.Spread.Sheets.SheetArea.viewport).hAlign(GC.Spread.Sheets.HorizontalAlign.left);
sheet.getCell(1,3, GC.Spread.Sheets.SheetArea.viewport).hAlign(GC.Spread.Sheets.HorizontalAlign.center);
sheet.getCell(2,3, GC.Spread.Sheets.SheetArea.viewport).hAlign(GC.Spread.Sheets.HorizontalAlign.right);
sheet.getCell(3,3, GC.Spread.Sheets.SheetArea.viewport).hAlign(GC.Spread.Sheets.HorizontalAlign.general);
sheet.setValue(0,3,"Horizontal Align is left",3);
sheet.setValue(1,3,"Horizontal Align is center",3);
sheet.setValue(2,3,"Horizontal Align is right",3);
sheet.setValue(3,3,"Horizontal Align is general",3);
activeSheet.options.selectionBackColor = "Accent 6";
activeSheet.options.selectionBorderColor = "Accent 1";
This example sets the background color for the selected cell or cells.
activeSheet.options.selectionBackColor = "rgba(204,255,51, 0.3)";
This example sets the border color for the selected cell or cells.
activeSheet.options.selectionBorderColor = "#FFFF00";
activeSheet.options.gridline = {color:"#FF2235", showVerticalGridline: true, showHorizontalGridline: false};
alert(activeSheet.options.gridline.color);
activeSheet.options.clipBoardOptions = GC.Spread.Sheets.ClipboardPasteOptions.values;
activeSheet.getRange(-1,2, -1, 1, GC.Spread.Sheets.SheetArea.viewport).backColor("blue").locked(false);
activeSheet.options.protectionOptions = {
    allowSelectLockedCells:false,
    allowSelectUnlockedCells: true,
};
activeSheet.options.isProtected = true;
Remarks

By default, the sheet displays both the vertical and horizontal grid lines.

The clipBoardOptions method only applies to copying and pasting data.

The following table applies to protectionOption.

allowSelectLockedCells boolean type True or undefined if the user can select locked cells.
allowSelectUnlockedCells boolean type True or undefined if the user can select unlocked cells.
allowSort boolean type True if the user can sort ranges.
allowFilter boolean type True if the user can filter ranges.
allowEditObjects boolean type True if the user can edit floating objects.
allowResizeRows boolean type True if the user can resize rows.
allowResizeColumns boolean type True if the user can resize columns.

The allowSort option applies to sorting in the filter dialog. The allowEditObjects option applies to selecting floating objects and selecting or editing comments.

This table lists the Worksheet options.

Name Type Description
allowCellOverflow boolean Specifies whether data can overflow into adjacent empty cells, optional.
sheetTabColor string A color string used to represent the sheet tab color, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on, optional.
frozenlineColor string A color string used to represent the frozen line color, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on, optional.
clipBoardOptions GC.Spread.Sheets.ClipboardPasteOptions The clipboard option, optional.
gridline object The grid line's options, optional.
gridline.color string The grid line color, optional.
gridline.showVerticalGridline boolean Specifies whether to show the vertical grid line, optional.
gridline.showHorizontalGridline boolean Specifies whether to show the horizontal grid line, optional.
rowHeaderVisible boolean Specifies whether the row header is visible, optional.
colHeaderVisible boolean Specifies whether the column header is visible, optional.
rowHeaderAutoText GC.Spread.Sheets.HeaderAutoText Specifies whether the row header displays letters or numbers or is blank, optional.
colHeaderAutoText GC.Spread.Sheets.HeaderAutoText Specifies whether the column header displays letters or numbers or is blank, optional.
rowHeaderAutoTextIndex number Specifies which row header column displays the automatic text when there are multiple row header columns, optional.
colHeaderAutoTextIndex number Specifies which column header row displays the automatic text when there are multiple column header rows, optional.
isProtected boolean Specifies whether cells on this sheet that are marked as protected cannot be edited, optional.
protectionOptions object A value that indicates the elements that you want users to be able to change, optional.
protectionOptions.allowSelectLockedCells boolean Specifies whether the user can select locked cells, optional.
protectionOptions.allowSelectUnlockedCells boolean Specifies whether the user can select unlocked cells, optional.
protectionOptions.allowSort boolean Specifies whether the user can sort ranges, optional.
protectionOptions.allowFilter boolean Specifies whether the user can filter ranges, optional.
protectionOptions.allowEditObjects boolean Specifies whether the user can edit floating objects, optional.
protectionOptions.allowResizeRows boolean Specifies whether the user can resize columns, optional.
selectionBackColor string The selection's background color for the sheet, optional.
selectionBorderColor string The selection's border color for the sheet, optional.
See Also

Reference

Sheets type
HeaderAutoText Enumeration
Allowing Cell Overflow

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.