setCellHyperLink - cfsimplicity/spreadsheet-cfml GitHub Wiki
Adds a hyperlink to a cell. If the cell doesn't exist it will be created.
setCellHyperLink( workbook, link, row, column[, cellValue[, type,[ format,[ tooltip ] ] ] ] )
Required arguments
workbookspreadsheet objectlinkstring: the URL or target of the hyperlinkrownumericcolumnnumeric
Optional arguments
cellValueany value to set in the cell which will be hyperlinkedtypestring default="URL": the type of hyperlink. Possible values:URL,Email,File(local file),Document(i.e. another part of the spreadsheet)formatstruct OR cellStyle object default={ color: "BLUE", underline: true }: See formatting optionstooltipstring: Text to appear when hovering over the hyperlink (NB: XLSX only and may not be supported by all spreadsheet software)
Chainable? Yes.
Example 1 external URL
spreadsheet = New spreadsheet();
workbook = spreadsheet.new();
spreadsheet.setCellHyperLink( workbook, "https://github.com/", 1, 1 );
Example 2 link to a local file
spreadsheet = New spreadsheet();
workbook = spreadsheet.new();
spreadsheet.setCellHyperLink( workbook, "anotherSpreadsheet.xls", 1, 1 );
Example 3 link to another cell in the same workbook
spreadsheet = New spreadsheet();
workbook = spreadsheet.new();
spreadsheet.setCellValue( workbook, "Please link to me", 1, 1 );
spreadsheet.setCellHyperLink( workbook, "'Sheet1'!A1", 2, 1, "OK I will" );