GridWorksheet

Inheritance: java.lang.Object, com.aspose.gridweb.Control

public class GridWorksheet extends Control

Encapsulates the object that represents a single worksheet.

Methods

MethodDescription
addAutoFilter(int row, int startColumn, int endColumn)Sets the range to which the specified AutoFilter applies.
addCustomFilter(int row, String critira)Add custom filter for the specified row.
autoFitColumn(int columnIndex)Autofits the column width.
autoFitColumn(int columnIndex, int firstRow, int lastRow)Autofits the column width.
autoFitRow(int rowIndex)Autofits the row height.
autoFitRow(int rowIndex, int firstColumn, int lastColumn)Autofits the row height.
autoFitRow(int startRow, int endRow, int startColumn, int endColumn)Autofits row height in a rectangle range.
autoFitRows()Autofits all rows in this worksheet.
autoFitRows(boolean onlyAuto)Autofits all rows in this worksheet.
autoFitRows(int startRow, int endRow)Autofits row height in a range.
calculateFormula(String formula)Calculates a formula.
clearComments()Clears all comments in designer spreadsheet.
copy(GridWorksheet sourceSheet)Copies contents and formats from another worksheet.
createSubtotal(int columnNameRowIndex, int dataRows, int groupByColumnIndex, int subtotalFunction, int[] subtotalColumnIndexList)Creates subtotal in the sheet.
createSubtotal(int columnNameRowIndex, int dataRows, int groupByColumnIndex, int subtotalFunction, int[] subtotalColumnIndexList, String functionLabel, GridTableItemStyle grandCellStyle, GridTableItemStyle subtotalCellStyle, int numberType, String customString)Creates subtotal in the sheet.
equals(Object arg0)
filterString(int column, String criteria)Sets the filter for the column.notice we shall call AddAutoFilter before calling of filterString The filter criteria string. notice we use comma->"," as split char,so the cell value you want to filter shall not contains with comma filterString(10,“123,456”) means column 10 shall contain 123 or 456, filterString(10,“123”) means column10 shall contain 123 the column index value split with comma,eg. 123,456,789 or abc
freezePanes(int row, int column, int freezedRows, int freezedColumns)Freezes panes at the specified cell in the worksheet.
freezePanes(String cellName, int freezedRows, int freezedColumns)Freezes panes at the specified cell in the worksheet.
getActiveCell()Gets the active cell in the worksheet.
getBackgroundImage()Gets worksheet background image.
getCells()Gets the GridCell collection.
getClass()
getCodeName()Represents worksheet code name.
getColumnCaption(int column)Gets the column caption.
getColumnHeaderToolTip(int colIndex)Gets the columnheader’s tooltip text.
getColumnReadonly(int columnIndex)Gets if a column is readonly.
getComments()Gets the GridComment collection.
getDisplayRightToLeft()Indicates if the specified worksheet is displayed from right to left instead of from left to right.
getDisplayZeros()True if zero values are displayed.
getFirstVisibleColumn()Represents first visible column index.
getFirstVisibleRow()Represents first visible row index.
getFreezedPanes()Gets the freeze panes.
getGridActiveCell()Gets the active cell in the worksheet.
getHyperlinks()Gets the GridHyperlinkCollection collection.
getIndex()Gets the index of sheet in the worksheet collection.
getIsReadonly(int row, int col)Gets whether the cell is readonly.this is an extended attribute of GridWeb ,it will not keep in actual excel file
getName()Gets the name of the worksheet.
getOutlineShown()Indicates whether show outline.
getPictures()Gets a getPictures() collection.
getPivotTables()Gets the pivotTables in the worksheet.
getRowCaption(int row)Gets the row caption.
getRowHeaderToolTip(int rowIndex)Gets the rowheader’s tooltip text.
getRowReadonly(int rowIndex)Gets if a row is readonly.
getSelected()Indicates whether this worksheet is selected when the workbook is opened.
getShapes()Gets a getPictures() collection.
getStandardHeight()Gets the default row height in this worksheet,in unit of points.
getStandardHeightPixels()Gets the default row height in this worksheet,in unit of pixels.
getTabColor()Represents worksheet tab color.
getUniqueID()Gets the UniqueID in the Control
getValidations()Gets the data validation setting collection in the worksheet.
getVisible()Indicates whether this sheet’s name is shown in the sheet tabs of the control.
getWorkbook()Gets the GridWorkbook object of the worksheet collection.
getZoom()Represents the scaling factor in percentage.
groupRows(int firstIndex, int lastIndex, boolean isHidden)Groups rows.
hashCode()
isGridlinesVisible()Gets a value indicating whether the grid lines are visible.Default is true.
isProtected()Indicates if the worksheet is protected.
isSummaryRowBelow()Indicates if the summary row will be positioned below the detail rows in the outline.
moveTo(int index)Moves the sheet to another location in the spreadsheet.
notify()
notifyAll()
refreshFilter()Refresh auto filters to hide or unhide the rows.
removeAutoFilter()Remove the auto filter of the worksheet.
removeSubtotal()Removes subtotal created by the CreateSubtotal method in the sheet.
resetFilter(int fieldIndex)The integer offset of the field on which you want to apply ,based on the first filter column (from the left of the list; the leftmost field is field 0).
setActiveCell(String value)Sets the active cell in the worksheet.
setAllCellsEditable()Makes all cells editable.this is extended attribute
setAllCellsReadonly()Makes all cells readonly.this is extended attribute notice this attribute can not keep in actual cell,if you want to keep protect please use setProtect
setBackgroundImage(byte[] value)Sets worksheet background image.
setColumnCaption(int column, String caption)Sets the caption for the column.please note this is an extension attribute and can not keep in excel file
setColumnHeaderToolTip(int colIndex, String toolTip)Sets the columnheader’s tooltip text.
setColumnReadonly(int columnIndex, boolean isReadonly)Sets a column to readonly so user can’t delete it from client side.
setDisplayRightToLeft(boolean value)Indicates if the specified worksheet is displayed from right to left instead of from left to right.
setDisplayZeros(boolean value)True if zero values are displayed.
setEditableRange(int startRow, int startColumn, int rows, int columns)Makes a range of cells editable. http://docs.aspose.com:8082/docs/display/cellsnet/Protecting+Cells Make all cells read only by calling the SetAllCellsReadonly method.
setFirstVisibleColumn(int value)Represents first visible column index.
setFirstVisibleRow(int value)Represents first visible row index.
setGridActiveCell(GridCell value)Sets the active cell in the worksheet.
setGridlinesVisible(boolean value)Sets a value indicating whether the grid lines are visible.Default is true.
setIsReadonly(int row, int col, boolean value)Sets whether the cell is readonly.this is an extended attribute of GridWeb ,it will not keep in actual excel file
setName(String value)Sets the name of the worksheet.
setOutlineShown(boolean value)Indicates whether show outline.
setProtect()Protects worksheet.
setReadonlyRange(int startRow, int startColumn, int rows, int columns)Makes a range of cells readonly. http://docs.aspose.com:8082/docs/display/cellsnet/Protecting+Cells First make all cells editable by calling the SetAllCellsEditable method.
setRowCaption(int row, String caption)Sets the caption for the row.
setRowHeaderToolTip(int rowIndex, String toolTip)Sets the rowheader’s tooltip text.
setRowReadonly(int rowIndex, boolean isReadonly)Sets a row to readonly so user can’t delete it from client side.
setSelected(boolean value)Indicates whether this worksheet is selected when the workbook is opened.
setStandardHeight(double value)Sets the default row height in this worksheet,in unit of points.
setStandardHeightPixels(int value)Sets the default row height in this worksheet,in unit of pixels.
setSummaryRowBelow(boolean value)Indicates if the summary row will be positioned below the detail rows in the outline.
setTabColor(Color value)Represents worksheet tab color.
setVisible(boolean value)Indicates whether this sheet’s name is shown in the sheet tabs of the control.
setZoom(int value)Represents the scaling factor in percentage.
toString()
unFreezePanes()Unfreezes panes in the worksheet.
unGroupRows(int firstIndex, int lastIndex)Ungroups rows.
unProtect()unProtects worksheet.
wait()
wait(long arg0)
wait(long arg0, int arg1)

addAutoFilter(int row, int startColumn, int endColumn)

public void addAutoFilter(int row, int startColumn, int endColumn)

Sets the range to which the specified AutoFilter applies.

Parameters:

ParameterTypeDescription
rowintRow index.
startColumnintStart column index.
endColumnintEnd column Index.

addCustomFilter(int row, String critira)

public void addCustomFilter(int row, String critira)

Add custom filter for the specified row.

Remarks

The filter criteria string. notice we use , and ; as split char,so the cell value shall not contains with those split char below are the criteria string examples //column 0 with value 12.3 CELL0 = 12.3 //column 1 with value ABC CELL1 = ABC //column 0 with value 123 or 456 or ABC and column 1 with value ABC CELL0 = 123,456,ABC; CELL1 = ABC

Parameters:

ParameterTypeDescription
rowint
critirajava.lang.String

autoFitColumn(int columnIndex)

public void autoFitColumn(int columnIndex)

Autofits the column width.

Remarks

AutoFitColumn is an imprecise function.

Parameters:

ParameterTypeDescription
columnIndexintColumn index.

autoFitColumn(int columnIndex, int firstRow, int lastRow)

public void autoFitColumn(int columnIndex, int firstRow, int lastRow)

Autofits the column width.

Remarks

This method autofits a row based on content in a range of cells within the row.

Parameters:

ParameterTypeDescription
columnIndexintColumn index.
firstRowintFirst row index.
lastRowintLast row index.

autoFitRow(int rowIndex)

public void autoFitRow(int rowIndex)

Autofits the row height.

Remarks

AutoFitRow is an imprecise function.

Parameters:

ParameterTypeDescription
rowIndexintRow index.

autoFitRow(int rowIndex, int firstColumn, int lastColumn)

public void autoFitRow(int rowIndex, int firstColumn, int lastColumn)

Autofits the row height.

Remarks

This method autofits a row based on content in a range of cells within the row.

Parameters:

ParameterTypeDescription
rowIndexintRow index.
firstColumnintFirst column index.
lastColumnintLast column index.

autoFitRow(int startRow, int endRow, int startColumn, int endColumn)

public void autoFitRow(int startRow, int endRow, int startColumn, int endColumn)

Autofits row height in a rectangle range.

Parameters:

ParameterTypeDescription
startRowintStart row index.
endRowintEnd row index.
startColumnintStart column index.
endColumnintEnd column index.

autoFitRows()

public void autoFitRows()

Autofits all rows in this worksheet.

autoFitRows(boolean onlyAuto)

public void autoFitRows(boolean onlyAuto)

Autofits all rows in this worksheet.

Parameters:

ParameterTypeDescription
onlyAutobooleanTrue,only autofits the row height when row height is not customed.

autoFitRows(int startRow, int endRow)

public void autoFitRows(int startRow, int endRow)

Autofits row height in a range.

Parameters:

ParameterTypeDescription
startRowintStart row index.
endRowintEnd row index.

calculateFormula(String formula)

public Object calculateFormula(String formula)

Calculates a formula.

Parameters:

ParameterTypeDescription
formulajava.lang.String

Returns: java.lang.Object -

clearComments()

public void clearComments()

Clears all comments in designer spreadsheet.

copy(GridWorksheet sourceSheet)

public void copy(GridWorksheet sourceSheet)

Copies contents and formats from another worksheet.

Parameters:

ParameterTypeDescription
sourceSheetGridWorksheetSource worksheet.

createSubtotal(int columnNameRowIndex, int dataRows, int groupByColumnIndex, int subtotalFunction, int[] subtotalColumnIndexList)

public void createSubtotal(int columnNameRowIndex, int dataRows, int groupByColumnIndex, int subtotalFunction, int[] subtotalColumnIndexList)

Creates subtotal in the sheet.

Parameters:

ParameterTypeDescription
columnNameRowIndexintThe row index of the column name row.
dataRowsintThe number of the data rows.
groupByColumnIndexintThe column index of the column to be grouped.
subtotalFunctionintSubtotalFunction. The subtotal function type.
subtotalColumnIndexListint[]The column indexes to be subtotaled.

createSubtotal(int columnNameRowIndex, int dataRows, int groupByColumnIndex, int subtotalFunction, int[] subtotalColumnIndexList, String functionLabel, GridTableItemStyle grandCellStyle, GridTableItemStyle subtotalCellStyle, int numberType, String customString)

public void createSubtotal(int columnNameRowIndex, int dataRows, int groupByColumnIndex, int subtotalFunction, int[] subtotalColumnIndexList, String functionLabel, GridTableItemStyle grandCellStyle, GridTableItemStyle subtotalCellStyle, int numberType, String customString)

Creates subtotal in the sheet.

Parameters:

ParameterTypeDescription
columnNameRowIndexintThe row index of the column name row.
dataRowsintThe number of the data rows.
groupByColumnIndexintThe column index of the column to be grouped.
subtotalFunctionintSubtotalFunction. The subtotal function type.
subtotalColumnIndexListint[]The column indexes to be subtotaled.
functionLabeljava.lang.StringThe label of subtotal function.
grandCellStyleGridTableItemStyleThe style of the grand total line.
subtotalCellStyleGridTableItemStyleThe style of the subtotal line.
numberTypeintNumberType. The number type of the subtotal result cells.
customStringjava.lang.StringThe custome format string of the subtotal result cells. Can be null.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

filterString(int column, String criteria)

public void filterString(int column, String criteria)

Sets the filter for the column.notice we shall call AddAutoFilter before calling of filterString The filter criteria string. notice we use comma->"," as split char,so the cell value you want to filter shall not contains with comma filterString(10,“123,456”) means column 10 shall contain 123 or 456, filterString(10,“123”) means column10 shall contain 123 the column index value split with comma,eg. 123,456,789 or abc

Parameters:

ParameterTypeDescription
columnint
criteriajava.lang.String

freezePanes(int row, int column, int freezedRows, int freezedColumns)

public void freezePanes(int row, int column, int freezedRows, int freezedColumns)

Freezes panes at the specified cell in the worksheet.

Remarks

Row index and column index cannot all be zero. Number of rows and number of columns also cannot all be zero.

The first two parameters specify the freezed position and the last two parameters specify the area freezed on the left top pane.

Parameters:

ParameterTypeDescription
rowintRow index.
columnintColumn index.
freezedRowsintNumber of visible rows in top pane, no more than row index.
freezedColumnsintNumber of visible columns in left pane, no more than column index.

freezePanes(String cellName, int freezedRows, int freezedColumns)

public void freezePanes(String cellName, int freezedRows, int freezedColumns)

Freezes panes at the specified cell in the worksheet.

Remarks

Row index and column index cannot all be zero. Number of rows and number of columns also cannot all be zero.

Parameters:

ParameterTypeDescription
cellNamejava.lang.StringCell name.
freezedRowsintNumber of visible rows in top pane, no more than row index.
freezedColumnsintNumber of visible columns in left pane, no more than column index.

getActiveCell()

public String getActiveCell()

Gets the active cell in the worksheet.

Returns: java.lang.String

getBackgroundImage()

public byte[] getBackgroundImage()

Gets worksheet background image.

Returns: byte[]

getCells()

public GridCells getCells()

Gets the GridCell collection.

Returns: GridCells

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getCodeName()

public String getCodeName()

Represents worksheet code name.

Remarks

You cannot change the code name while the template file contains VBA/macro.

Returns: java.lang.String

getColumnCaption(int column)

public String getColumnCaption(int column)

Gets the column caption. If the caption is not set, returns empty string.

Parameters:

ParameterTypeDescription
columnintColumn index.

Returns: java.lang.String - The column caption. If the caption is not set, returns empty string.

getColumnHeaderToolTip(int colIndex)

public String getColumnHeaderToolTip(int colIndex)

Gets the columnheader’s tooltip text.

Parameters:

ParameterTypeDescription
colIndexintThe column’s index.

Returns: java.lang.String - The tooltip text.

getColumnReadonly(int columnIndex)

public boolean getColumnReadonly(int columnIndex)

Gets if a column is readonly. this is extended method of GridWeb specifically,it will not keep and take affect in actual excel file

Parameters:

ParameterTypeDescription
columnIndexintcolumn index.

Returns: boolean - If readonly returns true.

getComments()

public GridCommentCollection getComments()

Gets the GridComment collection.

Returns: GridCommentCollection

getDisplayRightToLeft()

public boolean getDisplayRightToLeft()

Indicates if the specified worksheet is displayed from right to left instead of from left to right. Default is false.

Returns: boolean

getDisplayZeros()

public boolean getDisplayZeros()

True if zero values are displayed.

Returns: boolean

getFirstVisibleColumn()

public int getFirstVisibleColumn()

Represents first visible column index.

Returns: int

getFirstVisibleRow()

public int getFirstVisibleRow()

Represents first visible row index.

Returns: int

getFreezedPanes()

public int[] getFreezedPanes()

Gets the freeze panes.

Returns: int[] - Return null means the worksheet is not frozen 0:Row index;1:column;2:freezedRows;3:freezedRows

getGridActiveCell()

public GridCell getGridActiveCell()

Gets the active cell in the worksheet.

Returns: GridCell

public GridHyperlinkCollection getHyperlinks()

Gets the GridHyperlinkCollection collection.

Returns: GridHyperlinkCollection

getIndex()

public int getIndex()

Gets the index of sheet in the worksheet collection.

Returns: int

getIsReadonly(int row, int col)

public boolean getIsReadonly(int row, int col)

Gets whether the cell is readonly.this is an extended attribute of GridWeb ,it will not keep in actual excel file

Parameters:

ParameterTypeDescription
rowint
colint

Returns: boolean

getName()

public String getName()

Gets the name of the worksheet.

Remarks

The max length of sheet name is 31. And you cannot assign same name(case insensitive) to two worksheets. For example, you cannot set “SheetName1” to the first worksheet and set “SHEETNAME1” to the second worksheet.

Returns: java.lang.String

getOutlineShown()

public boolean getOutlineShown()

Indicates whether show outline.

Returns: boolean

getPictures()

public GridPictureCollection getPictures()

Gets a getPictures() collection.

Returns: GridPictureCollection

getPivotTables()

public GridPivotTableCollection getPivotTables()

Gets the pivotTables in the worksheet.

Returns: GridPivotTableCollection

getRowCaption(int row)

public String getRowCaption(int row)

Gets the row caption. If the caption is not set, returns empty string.

Parameters:

ParameterTypeDescription
rowintRow index.

Returns: java.lang.String - The row caption. If the caption is not set, returns empty string.

getRowHeaderToolTip(int rowIndex)

public String getRowHeaderToolTip(int rowIndex)

Gets the rowheader’s tooltip text.

Parameters:

ParameterTypeDescription
rowIndexintThe row’s index.

Returns: java.lang.String - The tooltip text.

getRowReadonly(int rowIndex)

public boolean getRowReadonly(int rowIndex)

Gets if a row is readonly. this is extended method of GridWeb specifically,it will not keep and take affect in actual excel file

Parameters:

ParameterTypeDescription
rowIndexintrow index.

Returns: boolean - If readonly returns true.

getSelected()

public boolean getSelected()

Indicates whether this worksheet is selected when the workbook is opened.

Returns: boolean

getShapes()

public GridShapeCollection getShapes()

Gets a getPictures() collection.

Returns: GridShapeCollection

getStandardHeight()

public double getStandardHeight()

Gets the default row height in this worksheet,in unit of points.

Returns: double

getStandardHeightPixels()

public int getStandardHeightPixels()

Gets the default row height in this worksheet,in unit of pixels.

Returns: int

getTabColor()

public Color getTabColor()

Represents worksheet tab color.

Remarks

This feature is only supported in ExcelXP(Excel2002) and above version. If you save file as Excel97 or Excel2000 format, it will be omitted.

Returns: Color

getUniqueID()

public String getUniqueID()

Gets the UniqueID in the Control

Returns: java.lang.String

getValidations()

public GridValidationCollection getValidations()

Gets the data validation setting collection in the worksheet.

Returns: GridValidationCollection

getVisible()

public boolean getVisible()

Indicates whether this sheet’s name is shown in the sheet tabs of the control.

Returns: boolean

getWorkbook()

public GridWorkbook getWorkbook()

Gets the GridWorkbook object of the worksheet collection.

Returns: GridWorkbook

getZoom()

public int getZoom()

Represents the scaling factor in percentage. It should be between 10 and 400.

Returns: int

groupRows(int firstIndex, int lastIndex, boolean isHidden)

public void groupRows(int firstIndex, int lastIndex, boolean isHidden)

Groups rows.

Parameters:

ParameterTypeDescription
firstIndexintThe first row index to be grouped.
lastIndexintThe last row index to be grouped.
isHiddenbooleanSpecifies if the grouped rows are hidden.

hashCode()

public native int hashCode()

Returns: int

isGridlinesVisible()

public boolean isGridlinesVisible()

Gets a value indicating whether the grid lines are visible.Default is true.

Returns: boolean

isProtected()

public boolean isProtected()

Indicates if the worksheet is protected.

Returns: boolean

isSummaryRowBelow()

public boolean isSummaryRowBelow()

Indicates if the summary row will be positioned below the detail rows in the outline.

Returns: boolean

moveTo(int index)

public void moveTo(int index)

Moves the sheet to another location in the spreadsheet.

Parameters:

ParameterTypeDescription
indexintDestination sheet index.

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

refreshFilter()

public void refreshFilter()

Refresh auto filters to hide or unhide the rows.

removeAutoFilter()

public void removeAutoFilter()

Remove the auto filter of the worksheet.

removeSubtotal()

public void removeSubtotal()

Removes subtotal created by the CreateSubtotal method in the sheet.

resetFilter(int fieldIndex)

public void resetFilter(int fieldIndex)

The integer offset of the field on which you want to apply ,based on the first filter column (from the left of the list; the leftmost field is field 0).

Parameters:

ParameterTypeDescription
fieldIndexint

setActiveCell(String value)

public void setActiveCell(String value)

Sets the active cell in the worksheet.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setAllCellsEditable()

public void setAllCellsEditable()

Makes all cells editable.this is extended attribute

setAllCellsReadonly()

public void setAllCellsReadonly()

Makes all cells readonly.this is extended attribute notice this attribute can not keep in actual cell,if you want to keep protect please use setProtect

setBackgroundImage(byte[] value)

public void setBackgroundImage(byte[] value)

Sets worksheet background image.

Parameters:

ParameterTypeDescription
valuebyte[]

setColumnCaption(int column, String caption)

public void setColumnCaption(int column, String caption)

Sets the caption for the column.please note this is an extension attribute and can not keep in excel file

Parameters:

ParameterTypeDescription
columnintColumn index.
captionjava.lang.StringThe column caption. Pass null or empty string if you want cancel the caption.

setColumnHeaderToolTip(int colIndex, String toolTip)

public void setColumnHeaderToolTip(int colIndex, String toolTip)

Sets the columnheader’s tooltip text.

Parameters:

ParameterTypeDescription
colIndexintThe column’s index.
toolTipjava.lang.StringThe tooltip text.

setColumnReadonly(int columnIndex, boolean isReadonly)

public void setColumnReadonly(int columnIndex, boolean isReadonly)

Sets a column to readonly so user can’t delete it from client side. this is extended method of GridWeb specifically,it will not keep and take affect in actual excel file

Parameters:

ParameterTypeDescription
columnIndexintcolumn index.
isReadonlybooleantrue or false.

setDisplayRightToLeft(boolean value)

public void setDisplayRightToLeft(boolean value)

Indicates if the specified worksheet is displayed from right to left instead of from left to right. Default is false.

Parameters:

ParameterTypeDescription
valueboolean

setDisplayZeros(boolean value)

public void setDisplayZeros(boolean value)

True if zero values are displayed.

Parameters:

ParameterTypeDescription
valueboolean

setEditableRange(int startRow, int startColumn, int rows, int columns)

public void setEditableRange(int startRow, int startColumn, int rows, int columns)

Makes a range of cells editable. http://docs.aspose.com:8082/docs/display/cellsnet/Protecting+Cells Make all cells read only by calling the SetAllCellsReadonly method. then call this method to Specify the range of cells that to be editable

Parameters:

ParameterTypeDescription
startRowintThe start row of the range.
startColumnintThe start column of the range.
rowsintThe number of the rows.
columnsintThe number of the columns.

setFirstVisibleColumn(int value)

public void setFirstVisibleColumn(int value)

Represents first visible column index.

Parameters:

ParameterTypeDescription
valueint

setFirstVisibleRow(int value)

public void setFirstVisibleRow(int value)

Represents first visible row index.

Parameters:

ParameterTypeDescription
valueint

setGridActiveCell(GridCell value)

public void setGridActiveCell(GridCell value)

Sets the active cell in the worksheet.

Parameters:

ParameterTypeDescription
valueGridCell

setGridlinesVisible(boolean value)

public void setGridlinesVisible(boolean value)

Sets a value indicating whether the grid lines are visible.Default is true.

Parameters:

ParameterTypeDescription
valueboolean

setIsReadonly(int row, int col, boolean value)

public void setIsReadonly(int row, int col, boolean value)

Sets whether the cell is readonly.this is an extended attribute of GridWeb ,it will not keep in actual excel file

Parameters:

ParameterTypeDescription
rowint
colint
valueboolean

setName(String value)

public void setName(String value)

Sets the name of the worksheet.

Remarks

The max length of sheet name is 31. And you cannot assign same name(case insensitive) to two worksheets. For example, you cannot set “SheetName1” to the first worksheet and set “SHEETNAME1” to the second worksheet.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setOutlineShown(boolean value)

public void setOutlineShown(boolean value)

Indicates whether show outline.

Parameters:

ParameterTypeDescription
valueboolean

setProtect()

public void setProtect()

Protects worksheet.

Remarks

This method protects worksheet without password. It can protect worksheet in all versions of Excel file.

setReadonlyRange(int startRow, int startColumn, int rows, int columns)

public void setReadonlyRange(int startRow, int startColumn, int rows, int columns)

Makes a range of cells readonly. http://docs.aspose.com:8082/docs/display/cellsnet/Protecting+Cells First make all cells editable by calling the SetAllCellsEditable method. then call this method to Specify the range of cells that to be readonly

Parameters:

ParameterTypeDescription
startRowintThe start row of the range.
startColumnintThe start column of the range.
rowsintThe number of the rows.
columnsintThe number of the columns.

setRowCaption(int row, String caption)

public void setRowCaption(int row, String caption)

Sets the caption for the row.

Parameters:

ParameterTypeDescription
rowintRow index.
captionjava.lang.StringThe row caption. Pass null or empty string if you want cancel the caption.

setRowHeaderToolTip(int rowIndex, String toolTip)

public void setRowHeaderToolTip(int rowIndex, String toolTip)

Sets the rowheader’s tooltip text.

Parameters:

ParameterTypeDescription
rowIndexintThe row’s index.
toolTipjava.lang.StringThe tooltip text.

setRowReadonly(int rowIndex, boolean isReadonly)

public void setRowReadonly(int rowIndex, boolean isReadonly)

Sets a row to readonly so user can’t delete it from client side. this is extended method of GridWeb specifically,it will not keep and take affect in actual excel file

Parameters:

ParameterTypeDescription
rowIndexintrow index.
isReadonlybooleantrue or false.

setSelected(boolean value)

public void setSelected(boolean value)

Indicates whether this worksheet is selected when the workbook is opened.

Parameters:

ParameterTypeDescription
valueboolean

setStandardHeight(double value)

public void setStandardHeight(double value)

Sets the default row height in this worksheet,in unit of points.

Parameters:

ParameterTypeDescription
valuedouble

setStandardHeightPixels(int value)

public void setStandardHeightPixels(int value)

Sets the default row height in this worksheet,in unit of pixels.

Parameters:

ParameterTypeDescription
valueint

setSummaryRowBelow(boolean value)

public void setSummaryRowBelow(boolean value)

Indicates if the summary row will be positioned below the detail rows in the outline.

Parameters:

ParameterTypeDescription
valueboolean

setTabColor(Color value)

public void setTabColor(Color value)

Represents worksheet tab color.

Remarks

This feature is only supported in ExcelXP(Excel2002) and above version. If you save file as Excel97 or Excel2000 format, it will be omitted.

Parameters:

ParameterTypeDescription
valueColor

setVisible(boolean value)

public void setVisible(boolean value)

Indicates whether this sheet’s name is shown in the sheet tabs of the control.

Parameters:

ParameterTypeDescription
valueboolean

setZoom(int value)

public void setZoom(int value)

Represents the scaling factor in percentage. It should be between 10 and 400.

Parameters:

ParameterTypeDescription
valueint

toString()

public String toString()

Returns: java.lang.String

unFreezePanes()

public void unFreezePanes()

Unfreezes panes in the worksheet.

unGroupRows(int firstIndex, int lastIndex)

public void unGroupRows(int firstIndex, int lastIndex)

Ungroups rows.

Remarks

Only removes outter group info.

Parameters:

ParameterTypeDescription
firstIndexintThe first row index to be ungrouped.
lastIndexintThe last row index to be ungrouped.

unProtect()

public void unProtect()

unProtects worksheet.

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int