cfsimplicity / spreadsheet-cfml

Standalone library for working with spreadsheets and CSV in CFML
MIT License
127 stars 36 forks source link

Some values are not converted to hyperlinks when using URL datatype #322

Closed cfsimplicity closed 1 year ago

cfsimplicity commented 1 year ago

I'm encountering an issue (using CF2016 or CF2021) where not all URL datatypes are being converted to links. I've extended your example to include 3 additional columns with the same exact URL value and the even columns (urls2 & urls4) aren't converting to hyperlinks.

spreadsheet = new luceeSpreadsheet.Spreadsheet();
workbook = spreadsheet.newStreamingXlsx();

testUri = "https://w3c.org";
testEmail = "test@test.com";
testFilePath = "test.xlsx";
data = QueryNew( "urls,urls2,urls3,urls4,emails,files", "VarChar,VarChar,VarChar,VarChar,VarChar,VarChar", [ [ testUri, testUri, testUri, testUri, testEmail, testFilePath ] ] );
datatypes = { url: [ "urls", "urls2", "urls3", "urls4" ], email: [ "emails" ], file: [ "files" ] };
spreadsheet.addRows( workbook=workbook, data=data, datatypes=datatypes, includeQueryColumnNames=true ).download(workbook, "test_#datetimeformat(now(), 'yyyymmddHHnnss')#.xlsx");

image

Originally posted by @JamoCA in https://github.com/cfsimplicity/spreadsheet-cfml/issues/316#issuecomment-1521864134

cfsimplicity commented 1 year ago

Issue found and (hopefully) fixed. Please could you check using the latest develop branch? Thanks.

JamoCA commented 1 year ago

I've tested it in production against a larger set of data and it is correctly creating clickable links for all url, mail and file datatypes.