public class HyperlinkCollection
Example:
//Instantiating a Workbook object Workbook workbook = new Workbook(); //Obtaining the reference of the newly added worksheet by passing its sheet index Worksheet worksheet = workbook.getWorksheets().get(0); //Get Hyperlinks Collection HyperlinkCollection hyperlinks = worksheet.getHyperlinks(); //Adding a hyperlink to a URL at "A1" cell hyperlinks.add("A1", 1, 1, "http://www.aspose.com"); //Saving the Excel file workbook.save("D:\\book1.xls");
Property Getters/Setters Summary | ||
---|---|---|
int | getCount() | |
Hyperlink | get(int index) | |
Gets the |
Method Summary | ||
---|---|---|
int | add(int firstRow, int firstColumn, int totalRows, int totalColumns, java.lang.String address) | |
Adds a hyperlink to a specified cell or a range of cells.
|
||
int | add(java.lang.Object value) | |
Reserved for internal use. |
||
int | add(java.lang.String cellName, int totalRows, int totalColumns, java.lang.String address) | |
Adds a hyperlink to a specified cell or a range of cells.
|
||
int | add(java.lang.String startCellName, java.lang.String endCellName, java.lang.String address, java.lang.String textToDisplay, java.lang.String screenTip) | |
Adds a hyperlink to a specified cell or a range of cells.
|
||
void | clear() | |
Clears all hyperlinks.
|
||
boolean | contains(java.lang.Object value) | |
Reserved for internal use. |
||
int | indexOf(java.lang.Object value) | |
Reserved for internal use. |
||
java.util.Iterator | iterator() | |
void | removeAt(int index) | |
Remove the hyperlink at the specified index.
|
public int getCount()
public Hyperlink get(int index)
index
- The zero based index of the element.public int add(int firstRow, int firstColumn, int totalRows, int totalColumns, java.lang.String address)
firstRow
- First row of the hyperlink range.firstColumn
- First column of the hyperlink range.totalRows
- Number of rows in this hyperlink range.totalColumns
- Number of columns of this hyperlink range.address
- Address of the hyperlink.Example:
Worksheet worksheet = excel.getWorksheets().get(0); worksheet.getHyperlinks().add("A4", 1, 1, "http://www.aspose.com"); worksheet.getHyperlinks().add("A5", 1, 1, "c:\\book1.xls");
public int add(java.lang.String cellName, int totalRows, int totalColumns, java.lang.String address)
cellName
- Cell name.totalRows
- Number of rows in this hyperlink range.totalColumns
- Number of columns of this hyperlink range.address
- Address of the hyperlink.public int add(java.lang.String startCellName, java.lang.String endCellName, java.lang.String address, java.lang.String textToDisplay, java.lang.String screenTip)
startCellName
- The top-left cell of the range.endCellName
- The bottom-right cell of the range.address
- Address of the hyperlink.textToDisplay
- The text to be displayed for the specified hyperlink.screenTip
- The screenTip text for the specified hyperlink.public void removeAt(int index)
index
- The zero based index of the element.public void clear()
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)