![]() |
||
Home Products Purchase Downloads Demos Forums Blogs Ticket Wiki API Corporate |
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.aspose.cells.Worksheets
public class Worksheets
Encapsulates a collection of Worksheet objects.
Method Summary | |
---|---|
int |
addCopy(int sheetIndex)
Adds a worksheet to the collection and copys data from an existed worksheet. |
int |
addCopy(java.lang.String sheetName)
Adds a worksheet to the collection and copys data from an existed worksheet. |
Worksheet |
addSheet()
Adds a new worksheet in this workbook. |
Worksheet |
addSheet(int type)
Adds a new worksheet in this workbook. |
Worksheet |
addSheet(int type,
java.lang.String sheetName)
Adds a new worksheet in this workbook with the specified sheet name. |
Worksheet |
addSheet(java.lang.String sheetName)
Adds a new worksheet in this workbook with the specified sheet name. |
void |
calculateFormula(int startIndex,
int endIndex,
boolean recursive,
boolean ignoreError)
Calculates formulas in some worksheets. |
Worksheet |
getActiveSheet()
Gets the active sheet. |
int |
getActiveSheetIndex()
Gets the active sheet index. |
BuiltInDocumentProperties |
getBuiltInDocumentProperties()
Returns a DocumentProperties collection that represents all the built-in document properties of the spreadsheet. |
CustomDocumentProperties |
getCustomDocumentProperties()
Returns a DocumentProperties collection that represents all the custom document properties of the spreadsheet. |
Name |
getName(java.lang.String name)
Gets Name object by pre-defined name. |
Name |
getName(java.lang.String name,
boolean strictScope)
Gets Name object by pre-defined name. |
NamedRange[] |
getNamedRanges()
Gets all pre-defined named ranges in the spreadsheet. |
Name[] |
getNames()
Gets all pre-defined named ranges in the spreadsheet. |
int |
getNumberOfSheets()
Deprecated. Replaced by size() . |
NamedRange |
getRangeByName(java.lang.String rangeName)
Gets NamedRange object by pre-defined name. |
NamedRange |
getRangeByName(java.lang.String rangeName,
boolean strictScope)
Gets NamedRange object by pre-defined name. |
Worksheet |
getSheet(int index)
Returns the sheet at the specified index. |
Worksheet |
getSheet(java.lang.String name)
Gets the sheet with the specified name. |
int |
getSheetIndex(java.lang.String name)
Gets the sheet's index according to its name. |
java.lang.String |
getSheetName(int index)
Returns the name of the sheet at the specified index. |
Name |
insertName(java.lang.String text,
java.lang.String refersTo)
Defines a new name. |
void |
moveSheet(int origin,
int dest)
Moves a worksheet. |
boolean |
removeName(java.lang.String text)
Deletes given Name. |
void |
removeSheet(int index)
Removes the sheet at the specified index. |
boolean |
removeSheet(java.lang.String sheetName)
Removes the specified sheet from the workbook. |
boolean |
removeSheet(Worksheet sheet)
Removes the specified worksheet. |
void |
setActiveSheet(int sheetIndex)
Sets the active sheet index. |
void |
setActiveSheet(Worksheet sheet)
Sets the active sheet. |
int |
size()
Gets the number of sheets in the workbook. |
void |
sortNames()
Sorts defined names. |
void |
swapSheet(int idx1,
int idx2)
Swaps the positions of two sheets. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public Worksheet addSheet()
public Worksheet addSheet(int type)
type
- Worksheet type.It could be one of the following values:
SheetType.WORKSHEET |
SheetType.CHART |
java.lang.IllegalArgumentException
- if sheet type is not Worksheet or Chart.public Worksheet addSheet(java.lang.String sheetName)
sheetName
- name of the worksheet.
public Worksheet addSheet(int type, java.lang.String sheetName)
sheetName
- name of the worksheet.type
- Worksheet type.
java.lang.IllegalArgumentException
- if sheet type is not Worksheet or Chart.addSheet(int)
@Deprecated public int getNumberOfSheets()
size()
.
public int size()
public Worksheet getSheet(int index)
index
- index of the sheet.
java.lang.IllegalArgumentException
- if the index is out of range.public Worksheet getSheet(java.lang.String name)
name
- name of the sheet.
public java.lang.String getSheetName(int index)
index
- index of the sheet.
java.lang.IllegalArgumentException
- if the index is out of range.public void swapSheet(int idx1, int idx2)
idx1
- index of the first sheetidx2
- index of the second sheet
java.lang.IllegalArgumentException
- if any of the positions is out of range.public void moveSheet(int origin, int dest)
origin
- the original index of the sheet.dest
- the new index of the sheet.
java.lang.IllegalArgumentException
- if any of the indexes is out of range.public void removeSheet(int index)
index
- index of the sheet.
java.lang.IllegalArgumentException
- if index is out of range.public boolean removeSheet(Worksheet sheet)
sheet
- the sheet to remove.
public boolean removeSheet(java.lang.String sheetName)
sheetName
- name of the sheet to remove
public int getActiveSheetIndex()
public Worksheet getActiveSheet()
public void setActiveSheet(int sheetIndex)
sheetIndex
- the active sheet index.
java.lang.IllegalArgumentException
- if the sheet index is out of range.public void setActiveSheet(Worksheet sheet)
sheet
- the active sheet.
CellsException
- if the sheet is not in this worksheets.public int getSheetIndex(java.lang.String name)
name
- name of the sheet.
public int addCopy(int sheetIndex)
sheetIndex
- Index of source worksheet.
public int addCopy(java.lang.String sheetName)
sheetName
- name of source worksheet.
public NamedRange getRangeByName(java.lang.String rangeName)
rangeName
- range name, can be plain name such as "name1" which means the Name's scope is workbook,
or with specific sheet reference such as "Sheet1!name1" which means the Name's scope is sheet.
getRangeByName(String, boolean)
public NamedRange getRangeByName(java.lang.String rangeName, boolean strictScope)
rangeName
- range name, can be plain name such as "name1" which means the Name's scope is workbook,
or with specific sheet reference such as "Sheet1!name1" which means the Name's scope is sheet.strictScope
- whether restrict the searched Name's scope.
If true, will only get the one whose scope is workbook or specified sheet given in rangeName;
If false, will search the NamedRange object ignore its scope.
public Name getName(java.lang.String name)
name
- name of Name object, can be plain name such as "name1" which means the Name's scope is workbook,
or with specific sheet reference such as "Sheet1!name1" which means the Name's scope is sheet.
getName(String, boolean)
public Name getName(java.lang.String name, boolean strictScope)
name
- name of Name object, can be plain name such as "name1" which means the Name's scope is workbook,
or with specific sheet reference such as "Sheet1!name1" which means the Name's scope is sheet.strictScope
- whether restrict the searched Name's scope.
If true, will only get the one whose scope is workbook or specified sheet given in name;
If false, will search the Name object ignore its scope.
public NamedRange[] getNamedRanges()
public Name[] getNames()
public void sortNames()
public Name insertName(java.lang.String text, java.lang.String refersTo) throws java.io.UnsupportedEncodingException
text
- the name text of the user-defined name.refersTo
- the formula that the name is defined to refer to, beginning with
an equal sign.
java.lang.IllegalArgumentException
- if refersTo is null or formulas in the refersTo are unspported.
java.io.UnsupportedEncodingException
- if text contains unsupported encoding.public boolean removeName(java.lang.String text)
text
- the name text of user-defined name.
public BuiltInDocumentProperties getBuiltInDocumentProperties()
public CustomDocumentProperties getCustomDocumentProperties()
public void calculateFormula(int startIndex, int endIndex, boolean recursive, boolean ignoreError) throws FormulaCalcException
startIndex
- start worksheet index.endIndex
- end worksheet index.recursive
- True if these worksheets' cells depend on the cells of other worksheets,
the dependant cells in other worksheets will be calculated too.
False means all the formulas in the worksheet have been calculated and the values are right.ignoreError
- Indicates if hide the error in calculating formulas.
The error may be unsupported function, external links, etc.
FormulaCalcException
- if an error occurs and not hide the error.
java.lang.IllegalArgumentException
- if the startIndex or endIndex is out of range.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |