What is the equivalent of this...
<cfspreadsheet action="read" src="#form.uploadedFile#" query="mycontent" >
in cfscript?
cfscript has spreadSheetRead(fileName) - but the result is an object with the file metadata, Even if I specify the sheet, it only returns metadata not row column data.
I need to loop over the rows... how do I do this?
I am trying to avoid exiting my script format, and interjecting 'cf' tag format...Any help is appreciated.
The cfspreadsheet tag always writes spreadsheet data as an XLS file. To write HTML variables or CSV variables as HTML or CSV files, use the cffile tag. Row number that contains column names. A Boolean value specifying whether to overwrite an existing file. Set a password for modifying the sheet.
read action: The variable in which to store the spreadsheet file data. Specify name or query. write and update actions: A variable containing CSV-format data or an ColdFusion spreadsheet object containing the data to write. Specify the name or query. name or query is required. read action: The query in which to store the converted spreadsheet file.
Reads the Excel file in src into a variable provided in name. Reads the Excel file in src into a ColdFusion query variable provided in query using the first row as column names.
Each ColdFusion spreadsheet object represents Excel sheet: To read an Excel file with multiple sheets, use multiple cfspreadsheet tags with the read option and specify different name and sheet or sheetname attributes for each sheet.
xls = SpreadsheetRead('C:\inetpub\wwwroot\myDomain\myDirectory\myFileName.xls');
for (row=2;row<=xls.rowCount;row+=1) {
WriteOutput(SpreadsheetGetCellValue(xls,row,1) & '<br>');
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With