public class WorksheetCollection
Example:
Workbook workbook = new Workbook(); WorksheetCollection sheets = workbook.getWorksheets(); //Add a worksheet sheets.add(); //Change the name of a worksheet sheets.get(0).setName("First Sheet"); //Set the active sheet to the second worksheet sheets.setActiveSheetIndex(1);
Property Getters/Setters Summary | ||
---|---|---|
int | getActiveSheetIndex() | |
void | setActiveSheetIndex(intvalue) | |
Represents the index of active worksheet when the spreadsheet is opened. | ||
BuiltInDocumentPropertyCollection | getBuiltInDocumentProperties() | |
Returns a DocumentProperties collection that represents all the built-in document properties of the spreadsheet.
|
||
int | getCount() | |
CustomDocumentPropertyCollection | getCustomDocumentProperties() | |
Returns a DocumentProperties collection that represents all the custom document properties of the spreadsheet.
|
||
DxfCollection | getDxfs() | |
Gets the master differential formatting records.
|
||
ExternalLinkCollection | getExternalLinks() | |
Represents external links in a workbook.
|
||
boolean | isRefreshAllConnections() | |
void | setRefreshAllConnections(booleanvalue) | |
Indicates whether refresh all connections on opening file in MS Excel. | ||
NameCollection | getNames() | |
Gets the collection of all the Name objects in the spreadsheet.
|
||
java.lang.Object | getOleSize() | |
void | setOleSize(java.lang.Objectvalue) | |
Gets and Sets displayed size when Workbook file is used as an Ole object. | ||
RevisionLogCollection | getRevisionLogs() | |
Represents revision logs.
|
||
TableStyleCollection | getTableStyles() | |
Gets |
||
ThreadedCommentAuthorCollection | getThreadedCommentAuthors() | |
Gets the list of threaded comment authors.
|
||
WebExtensionCollection | getWebExtensions() | |
Gets the list of task panes.
|
||
WebExtensionTaskPaneCollection | getWebExtensionTaskPanes() | |
Gets the list of task panes.
|
||
XmlMapCollection | getXmlMaps() | |
void | setXmlMaps(XmlMapCollection value) | |
Gets and sets the XML maps in the workbook. | ||
Worksheet | get(int index) | |
Gets the |
||
Worksheet | get(java.lang.String sheetName) | |
Gets the |
Method Summary | ||
---|---|---|
int | add() | |
Adds a worksheet to the collection.
|
||
int | add(int type) | |
Adds a worksheet to the collection.
|
||
int | add(java.lang.Object value) | |
Reserved for internal use. |
||
Worksheet | add(java.lang.String sheetName) | |
Adds a worksheet to the collection.
|
||
int | addCopy(int sheetIndex) | |
Adds a worksheet to the collection and copies data from an existed worksheet.
|
||
int | addCopy(java.lang.String sheetName) | |
Adds a worksheet to the collection and copies data from an existed worksheet.
|
||
void | clear() | |
Clear all worksheets.
|
||
void | clearPivottables() | |
Clears pivot tables from the spreadsheet.
|
||
boolean | contains(java.lang.Object value) | |
Reserved for internal use. |
||
Range | createRange(java.lang.String address, int sheetIndex) | |
Creates a |
||
com.aspose.cells.Range[] | getNamedRanges() | |
Gets all pre-defined named ranges in the spreadsheet.
|
||
com.aspose.cells.Range[] | getNamedRangesAndTables() | |
Gets all pre-defined named ranges in the spreadsheet.
|
||
Range | getRangeByName(java.lang.String rangeName) | |
Gets Range object by pre-defined name.
|
||
Worksheet | getSheetByCodeName(java.lang.String codeName) | |
Gets the worksheet by the code name.
|
||
int | indexOf(java.lang.Object value) | |
Reserved for internal use. |
||
Worksheet | insert(int index, int sheetType) | |
Insert a worksheet.
|
||
Worksheet | insert(int index, int sheetType, java.lang.String sheetName) | |
Insert a worksheet.
|
||
java.util.Iterator | iterator() | |
void | refreshPivotTables() | |
Refreshes all the PivotTables in the WorksheetCollection.
|
||
java.lang.String | registerAddInFunction(int id, java.lang.String functionName) | |
Adds addin function into the workbook
|
||
int | registerAddInFunction(java.lang.String addInFile, java.lang.String functionName, boolean lib) | |
Adds addin function into the workbook
|
||
void | removeAt(int index) | |
Removes the element at a specified index.
|
||
void | removeAt(java.lang.String name) | |
Removes the element at a specified name.
|
||
void | setOleSize(int startRow, int endRow, int startColumn, int endColumn) | |
Sets displayed size when Workbook file is used as an Ole object.
|
||
void | sortNames() | |
Sorts the defined names.
|
||
void | swapSheet(int sheetIndex1, int sheetIndex2) | |
Swaps the two sheets.
|
public WebExtensionTaskPaneCollection getWebExtensionTaskPanes()
public WebExtensionCollection getWebExtensions()
public ThreadedCommentAuthorCollection getThreadedCommentAuthors()
public boolean isRefreshAllConnections() / public void setRefreshAllConnections(boolean value)
public NameCollection getNames()
public int getActiveSheetIndex() / public void setActiveSheetIndex(int value)
public DxfCollection getDxfs()
public XmlMapCollection getXmlMaps() / public void setXmlMaps(XmlMapCollection value)
public BuiltInDocumentPropertyCollection getBuiltInDocumentProperties()
Title
Subject
Author
Keywords
Comments
Template
Last Author
Revision Number
Application Name
Last Print Date
Creation Date
Last Save Time
Total Editing Time
Number of Pages
Number of Words
Number of Characters
Security
Category
Format
Manager
Company
Number of Bytes
Number of Lines
Number of Paragraphs
Number of Slides
Number of Notes
Number of Hidden Slides
Number of Multimedia Clips
Example:
DocumentProperty doc = workbook.getWorksheets().getBuiltInDocumentProperties().get("Author"); doc.setValue("John Smith");
public CustomDocumentPropertyCollection getCustomDocumentProperties()
Example:
excel.getWorksheets().getCustomDocumentProperties().add("Checked by", "Jane");
public java.lang.Object getOleSize() / public void setOleSize(java.lang.Object value)
public ExternalLinkCollection getExternalLinks()
public TableStyleCollection getTableStyles()
public RevisionLogCollection getRevisionLogs()
public int getCount()
public Worksheet get(int index)
index
- The zero based index of the element.public Worksheet get(java.lang.String sheetName)
sheetName
- Worksheet namepublic void setOleSize(int startRow, int endRow, int startColumn, int endColumn)
startRow
- Start row index.endRow
- End row index.startColumn
- Start column index.endColumn
- End column index.public void clearPivottables()
public void refreshPivotTables() throws java.lang.Exception
public Range createRange(java.lang.String address, int sheetIndex)
public Worksheet getSheetByCodeName(java.lang.String codeName)
codeName
- Worksheet code name.public void sortNames()
public Worksheet insert(int index, int sheetType)
index
- The sheet indexsheetType
- A public Worksheet insert(int index, int sheetType, java.lang.String sheetName)
index
- The sheet indexsheetType
- A sheetName
- The sheet name.public int add(int type)
type
- A Example:
Workbook workbook = new Workbook(); workbook.getWorksheets().add(SheetType.CHART); Cells cells = workbook.getWorksheets().get(0).getCells(); cells.get("c2").putValue(5000); cells.get("c3").putValue(3000); cells.get("c4").putValue(4000); cells.get("c5").putValue(5000); cells.get("c6").putValue(6000); ChartCollection charts = workbook.getWorksheets().get(1).getCharts(); int chartIndex = charts.add(ChartType.COLUMN, 10, 10, 20, 20); Chart chart = charts.get(chartIndex); chart.getNSeries().add("Sheet1!C2:C6", true);
public void swapSheet(int sheetIndex1, int sheetIndex2)
sheetIndex1
- The first worksheet.sheetIndex2
- The second worksheet.public int add()
public Worksheet add(java.lang.String sheetName)
public int registerAddInFunction(java.lang.String addInFile, java.lang.String functionName, boolean lib)
addInFile
- the file contains the addin functionsfunctionName
- the addin function namelib
- whether the given addin file is in the directory or sub-directory of Workbook Add-In library.
This flag takes effect and mkes difference when given addInFile is of relative path:
true denotes the path is relative to Add-In library and false denotes the path is relative to this Workbook.public java.lang.String registerAddInFunction(int id, java.lang.String functionName)
id
- ID of the data which contains addin functions,
can be got by the first call of functionName
- the addin function namepublic void removeAt(java.lang.String name)
name
- The name of the element to remove.public void removeAt(int index)
index
- The index value of the element to remove.public void clear()
public int addCopy(java.lang.String sheetName) throws java.lang.Exception
sheetName
- Name of source worksheet.public int addCopy(int sheetIndex) throws java.lang.Exception
sheetIndex
- Index of source worksheet.public Range getRangeByName(java.lang.String rangeName)
rangeName
- Name of range.public com.aspose.cells.Range[] getNamedRanges()
public com.aspose.cells.Range[] getNamedRangesAndTables()
public java.util.Iterator iterator()
public boolean contains(java.lang.Object value)
public int add(java.lang.Object value)
public int indexOf(java.lang.Object value)