Package com.grapecity.documents.excel
Interface IWorksheets
- All Superinterfaces:
Iterable<IWorksheet>
Represents a collection of all the sheets in the workbook.
-
Method Summary
Modifier and TypeMethodDescriptionadd()Creates a new worksheet.Creates a new sheet.addAfter(IWorksheet sheet) Creates a new worksheet and inserts it after the specified sheet.addBefore(IWorksheet sheet) Creates a new worksheet and inserts it before the specified sheet.booleancontains(IWorksheet worksheet) Returns true if the specified Worksheet is contained by the collection of worksheets; otherwise, false is returned.copy()Copies the sheet collection to the end of the current workbook.Copies the sheet collection to the end of the specified workbook.copyAfter(IWorksheet targetWorksheet) Copies the sheet collection to the location after the specified sheet.copyBefore(IWorksheet targetWorksheet) Copies the sheet collection to the location before the specified sheet.get(int index) Gets the worksheet using the index.Gets the worksheet using the name.Gets worksheets by names.intgetCount()Returns the number of objects in the collection.intindexOf(IWorksheet worksheet) Returns the zero-based index of the specified worksheet in the collection.move()Moves the sheet collection to the end of the current workbook.Copies the sheet collection to the end of the specified workbook.moveAfter(IWorksheet targetWorksheet) Moves the sheet collection to the location after the specified sheet.moveBefore(IWorksheet targetWorksheet) Moves the sheet collection to the location before the specified sheet.voidselect()Selects the object.voidselect(boolean replace) Selects the object.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
getCount
int getCount()Returns the number of objects in the collection. -
get
Gets the worksheet using the index.- Parameters:
index- The index.
-
get
Gets the worksheet using the name.- Parameters:
name- The worksheet's name.
-
get
Gets worksheets by names.- Parameters:
name- An array that represents names of worksheets.
-
select
void select()Selects the object. -
select
void select(boolean replace) Selects the object.- Parameters:
replace- Used only with IWorkbook.Worksheets.True to replace the current selection with the specified object. False to extend the current selection to include any previously selected objects and the specified object.
-
add
IWorksheet add()Creates a new worksheet. The new worksheet becomes the active sheet.- Returns:
- the new worksheet.
-
add
Creates a new sheet. The new sheet becomes the active sheet.- Parameters:
type- The sheet's type.- Returns:
- the new worksheet.
-
addAfter
Creates a new worksheet and inserts it after the specified sheet.- Parameters:
sheet- The insert sheet.- Returns:
- the new worksheet.
-
addBefore
Creates a new worksheet and inserts it before the specified sheet.- Parameters:
sheet- The specified sheet index.- Returns:
- the new worksheet.
-
contains
Returns true if the specified Worksheet is contained by the collection of worksheets; otherwise, false is returned.- Parameters:
worksheet- TheIWorksheetobject.- Returns:
- Returns whether the specified worksheet is contained by thecollection of worksheets.
-
copy
IWorksheets copy()Copies the sheet collection to the end of the current workbook.- Returns:
- The new copied sheet collection.
-
copy
Copies the sheet collection to the end of the specified workbook.- Parameters:
targetWorkbook- Specifies the workbook to which the sheet collection will be copied.- Returns:
- The new copied sheet collection.
-
copyAfter
Copies the sheet collection to the location after the specified sheet.- Parameters:
targetWorksheet- The sheet after which the copied sheet collection will be placed. It can be the sheet of the same or another workbook.- Returns:
- The new copied sheet collection.
-
copyBefore
Copies the sheet collection to the location before the specified sheet.- Parameters:
targetWorksheet- The sheet before which the copied sheet collection will be placed. It can be the sheet of the same or another workbook.- Returns:
- The new copied sheet collection.
-
move
IWorksheets move()Moves the sheet collection to the end of the current workbook.- Returns:
- The moved sheet collection.
-
move
Copies the sheet collection to the end of the specified workbook.- Parameters:
targetWorkbook- Specifies the workbook to which the sheet collection will be moved.- Returns:
- The moved sheet collection.
-
moveAfter
Moves the sheet collection to the location after the specified sheet.- Parameters:
targetWorksheet- The sheet after which the moved sheet collection will be placed. It can be the sheet of the same or another workbook.- Returns:
- The moved sheet collection.
-
moveBefore
Moves the sheet collection to the location before the specified sheet.- Parameters:
targetWorksheet- The sheet before which the moved sheet collection will be placed. It can be the sheet of the same or another workbook.- Returns:
- The moved sheet collection.
-
indexOf
Returns the zero-based index of the specified worksheet in the collection.- Parameters:
worksheet- TheIWorksheetobject.- Returns:
- Returns the zero-based index of the specified worksheet in thecollection.
-