Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cfscript equivalent of cfspreadsheet action="read"

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.

like image 408
j-p Avatar asked Jan 16 '14 20:01

j-p


People also ask

How do I use the cfspreadsheet tag?

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.

What is read action and write action in ColdFusion?

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.

How does ColdFusion read the Excel file in SRC?

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.

How to read multiple sheets in a ColdFusion spreadsheet?

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.


1 Answers

xls = SpreadsheetRead('C:\inetpub\wwwroot\myDomain\myDirectory\myFileName.xls');
for (row=2;row<=xls.rowCount;row+=1) {
    WriteOutput(SpreadsheetGetCellValue(xls,row,1) & '<br>');
}
like image 125
Phillip Senn Avatar answered Sep 28 '22 12:09

Phillip Senn