Sathya M
12/26/2024, 4:01 PMSathya M
12/26/2024, 4:01 PMErin Brewer
12/26/2024, 4:23 PMe.g.
<a href="testlink">my link</a>
is being shown as a hyperlink?
Sathya M
12/27/2024, 4:01 AMErin Brewer
12/27/2024, 3:16 PMSathya M
12/30/2024, 8:34 AM'A power hub <a href="<https://www.amazon.com/>">Visit</a>'
While writing to the excel, it is rendering like the same html tags instead of hyperlinks. I've tried the below (also tried manually updating the tags with chr, more and more. I am just pulling my hair out for this)
<cfset excelData = 'TEXTJOIN("", TRUE, "A power hub", HYPERLINK("<https://www.amazon.com/>", "Visit"))'>
<cfset spreadsheetSetCellFormula(sheet, "#excelData#", 1, 1)>
Erin Brewer
12/30/2024, 3:36 PM<cfset spreadsheetObj = SpreadsheetNew("My Sheet")>
<!-- Add a hyperlink --->
<cfset SpreadsheetSetCellValue(spreadsheetObj, '=HYPERLINK("<http://www.example.com>", "Example Website")', 1, 1)>
<!-- Write the spreadsheet to a file -->
<cfspreadsheet action="write" filename="example.xlsx" name="spreadsheetObj">
Erin Brewer
12/30/2024, 3:38 PMSathya M
12/30/2024, 3:44 PMErin Brewer
12/30/2024, 3:49 PMExcel does not natively support partial hyperlinks within a single cell. Each cell can only contain a single hyperlink that applies to the entire content of the cell.
If you need to format only part of the text in a cell as a hyperlink, you would need to use Rich Text Formatting in Excel, which is not directly supported by ColdFusion's <cfspreadsheet> or Spreadsheet functions
Sathya M
12/30/2024, 3:50 PMErin Brewer
12/30/2024, 3:51 PMErin Brewer
12/30/2024, 3:53 PMSathya M
12/30/2024, 3:54 PMErin Brewer
12/30/2024, 3:56 PM// In Java, use Apache POI's XSSFRichTextString to create partial hyperlinks
XSSFRichTextString richText = new XSSFRichTextString("This is a test website");
richText.applyFont(10, 17, hyperlinkFont); // Apply hyperlink font styling to "website"
cell.setCellValue(richText);
Sathya M
12/31/2024, 3:55 AM