public class HyperlinkCollection extends CollectionBase
Hyperlink objects.
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("book1.xls");
| Modifier and Type | Method and Description |
|---|---|
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.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.
|
Hyperlink |
get(int index)
Gets the
Hyperlink element at the specified index. |
void |
removeAt(int index)
Remove the hyperlink at the specified index in this collection.
|
public int add(int firstRow,
int firstColumn,
int totalRows,
int totalColumns,
java.lang.String address)
Example
//Instantiating a Workbook object
Workbook excel = new Workbook();
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");
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.Hyperlink object index.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.Hyperlink object index.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.Hyperlink object index.public Hyperlink get(int index)
Hyperlink element at the specified index.get in class CollectionBaseindex - The zero based index of the element.public void removeAt(int index)
removeAt in class CollectionBaseindex - The zero based index of the element.public void clear()
clear in class CollectionBaseSee Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.