java.lang.ObjectCollectionBase
com.aspose.cells.WorksheetCollection
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.setActiveSheet(1);
Property Getters/Setters Summary | ||
---|---|---|
int | getActiveSheetIndex() | |
void | setActiveSheetIndex(int value) | |
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() | → inherited from com.aspose.cells.CollectionBase |
CustomDocumentPropertyCollection | getCustomDocumentProperties() | |
Returns a DocumentProperties collection that represents all the custom document properties of the spreadsheet. | ||
boolean | getEnableHTTPCompression() | |
void | setEnableHTTPCompression(boolean value) | |
Indicates if http compression is to be used in user's IIS. | ||
ExternalLinkCollection | getExternalLinks() | |
Represents external links in a workbook. | ||
boolean | getHidePivotFieldList() | |
void | setHidePivotFieldList(boolean value) | |
Gets whether hide the field list for the PivotTable. | ||
boolean | isHidden() | |
void | setHidden(boolean value) | |
Indicates whether this workbook is hidden. | ||
boolean | isMinimized() | |
void | setMinimized(boolean value) | |
Represents whether the generated spreadsheet will be opened Minimized. | ||
boolean | isRefreshAllConnections() | |
void | setRefreshAllConnections(boolean value) | |
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.Object value) | |
Gets and Sets displayed size when Workbook file is used as an Ole object. | ||
int | getSheetTabBarWidth() | |
void | setSheetTabBarWidth(int value) | |
Width of worksheet tab bar (in 1/1000 of window width). | ||
TableStyleCollection | getTableStyles() | |
Gets |
||
double | getWindowHeight() | |
void | setWindowHeight(double value) | |
The height of the window, in unit of point. | ||
double | getWindowHeightCM() | |
void | setWindowHeightCM(double value) | |
The height of the window,in unit of centimeter. | ||
double | getWindowHeightInch() | |
void | setWindowHeightInch(double value) | |
The height of the window,in unit of inch. | ||
double | getWindowLeft() | |
void | setWindowLeft(double value) | |
The distance from the left edge of the client area to the left edge of the window, in unit of point. | ||
double | getWindowLeftCM() | |
void | setWindowLeftCM(double value) | |
The distance from the left edge of the client area to the left edge of the window. In unit of centimeter. | ||
double | getWindowLeftInch() | |
void | setWindowLeftInch(double value) | |
The distance from the left edge of the client area to the left edge of the window. In unit of inch. | ||
double | getWindowTop() | |
void | setWindowTop(double value) | |
The distance from the top edge of the client area to the top edge of the window, in unit of point. | ||
double | getWindowTopCM() | |
void | setWindowTopCM(double value) | |
The distance from the top edge of the client area to the top edge of the window,in unit of centimeter. | ||
double | getWindowTopInch() | |
void | setWindowTopInch(double value) | |
The distance from the top edge of the client area to the top edge of the window,in unit of inch. | ||
double | getWindowWidth() | |
void | setWindowWidth(double value) | |
The width of the window, in unit of point. | ||
double | getWindowWidthCM() | |
void | setWindowWidthCM(double value) | |
The width of the window,in unit of centimeter. | ||
double | getWindowWidthInch() | |
void | setWindowWidthInch(double value) | |
The width of the window,in unit of inch. | ||
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) | → inherited from com.aspose.cells.CollectionBase |
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. | ||
boolean | contains(java.lang.Object value) | → inherited from com.aspose.cells.CollectionBase |
Reserved for internal use. | ||
void | deleteName(java.lang.String definedName) | |
Deletes a defined name in the workbook. | ||
java.lang.Object | get(int index) | → inherited from com.aspose.cells.CollectionBase |
Reserved for internal use. | ||
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) | → inherited from com.aspose.cells.CollectionBase |
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() | → inherited from com.aspose.cells.CollectionBase |
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 defined names. | ||
void | swapSheet(int sheetIndex1, int sheetIndex2) | |
Swaps the two sheets. |
Property Getters/Setters Detail |
---|
getHidePivotFieldList/setHidePivotFieldList | |
public boolean getHidePivotFieldList() / public void setHidePivotFieldList(boolean value) |
isRefreshAllConnections/setRefreshAllConnections | |
public boolean isRefreshAllConnections() / public void setRefreshAllConnections(boolean value) |
getNames | |
public NameCollection getNames() |
getEnableHTTPCompression/setEnableHTTPCompression | |
public boolean getEnableHTTPCompression() / public void setEnableHTTPCompression(boolean value) |
getActiveSheetIndex/setActiveSheetIndex | |
public int getActiveSheetIndex() / public void setActiveSheetIndex(int value) |
isMinimized/setMinimized | |
public boolean isMinimized() / public void setMinimized(boolean value) |
isHidden/setHidden | |
public boolean isHidden() / public void setHidden(boolean value) |
getWindowLeft/setWindowLeft | |
public double getWindowLeft() / public void setWindowLeft(double value) |
getWindowLeftInch/setWindowLeftInch | |
public double getWindowLeftInch() / public void setWindowLeftInch(double value) |
getWindowLeftCM/setWindowLeftCM | |
public double getWindowLeftCM() / public void setWindowLeftCM(double value) |
getWindowTop/setWindowTop | |
public double getWindowTop() / public void setWindowTop(double value) |
getWindowTopInch/setWindowTopInch | |
public double getWindowTopInch() / public void setWindowTopInch(double value) |
getWindowTopCM/setWindowTopCM | |
public double getWindowTopCM() / public void setWindowTopCM(double value) |
getWindowWidth/setWindowWidth | |
public double getWindowWidth() / public void setWindowWidth(double value) |
getWindowWidthInch/setWindowWidthInch | |
public double getWindowWidthInch() / public void setWindowWidthInch(double value) |
getWindowWidthCM/setWindowWidthCM | |
public double getWindowWidthCM() / public void setWindowWidthCM(double value) |
getWindowHeight/setWindowHeight | |
public double getWindowHeight() / public void setWindowHeight(double value) |
getWindowHeightInch/setWindowHeightInch | |
public double getWindowHeightInch() / public void setWindowHeightInch(double value) |
getWindowHeightCM/setWindowHeightCM | |
public double getWindowHeightCM() / public void setWindowHeightCM(double value) |
getSheetTabBarWidth/setSheetTabBarWidth | |
public int getSheetTabBarWidth() / public void setSheetTabBarWidth(int value) |
getXmlMaps/setXmlMaps | |
public XmlMapCollection getXmlMaps() / public void setXmlMaps(XmlMapCollection value) |
getBuiltInDocumentProperties | |
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");
getCustomDocumentProperties | |
public CustomDocumentPropertyCollection getCustomDocumentProperties() |
Example:
excel.getWorksheets().getCustomDocumentProperties().add("Checked by", "Jane");
getOleSize/setOleSize | |
public java.lang.Object getOleSize() / public void setOleSize(java.lang.Object value) |
getExternalLinks | |
public ExternalLinkCollection getExternalLinks() |
getTableStyles | |
public TableStyleCollection getTableStyles() |
getCount | → inherited from com.aspose.cells.CollectionBase |
public int getCount() |
get | |
public Worksheet get(int index) |
index
- The zero based index of the element.get | |
public Worksheet get(java.lang.String sheetName) |
sheetName
- Worksheet nameMethod Detail |
---|
getRangeByName | |
public Range getRangeByName(java.lang.String rangeName) |
rangeName
- Name of range.getNamedRanges | |
public com.aspose.cells.Range[] getNamedRanges() |
getNamedRangesAndTables | |
public com.aspose.cells.Range[] getNamedRangesAndTables() |
setOleSize | |
public 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.deleteName | |
public void deleteName(java.lang.String definedName) |
definedName
- Defined name.getSheetByCodeName | |
public Worksheet getSheetByCodeName(java.lang.String codeName) |
codeName
- Worksheet code name.sortNames | |
public void sortNames() |
insert | |
public Worksheet insert(int index, int sheetType) |
index
- The sheet indexsheetType
- A insert | |
public Worksheet insert(int index, int sheetType, java.lang.String sheetName) |
index
- The sheet indexsheetType
- A sheetName
- The sheet name.add | |
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);
swapSheet | |
public void swapSheet(int sheetIndex1, int sheetIndex2) |
sheetIndex1
- The first worksheet.sheetIndex2
- The second worksheet.add | |
public int add() |
add | |
public Worksheet add(java.lang.String sheetName) |
sheetName
- Worksheet nameremoveAt | |
public void removeAt(java.lang.String name) |
name
- The name of the element to remove.removeAt | |
public void removeAt(int index) |
index
- The index value of the element to remove.clear | |
public void clear() |
addCopy | |
public int addCopy(java.lang.String sheetName) throws java.lang.Exception |
sheetName
- Name of source worksheet.addCopy | |
public int addCopy(int sheetIndex) throws java.lang.Exception |
sheetIndex
- Index of source worksheet.iterator | → inherited from com.aspose.cells.CollectionBase |
public java.util.Iterator iterator() |
get | → inherited from com.aspose.cells.CollectionBase |
public java.lang.Object get(int index) |
contains | → inherited from com.aspose.cells.CollectionBase |
public boolean contains(java.lang.Object value) |
add | → inherited from com.aspose.cells.CollectionBase |
public int add(java.lang.Object value) |
indexOf | → inherited from com.aspose.cells.CollectionBase |
public int indexOf(java.lang.Object value) |