downloadCsvFromFile - cfsimplicity/spreadsheet-cfml GitHub Wiki
Provides a quick way of downloading a CSV file generated from an Excel spreadsheet file.
downloadCsvFromFile( src, filename[, columns [, columnNames [, headerRow [, rows [, sheetName [, includeHeaderRow [, includeBlankRows [, fillMergedCellsWithVisibleValue [, includeHiddenColumns [, delimiter ] ] ] ] ] ] ] ] ] ] )
or
downloadCsvFromFile( src, filename, [columns [, columnNames [, headerRow [, rows [, sheetNumber [, includeHeaderRow [, includeBlankRows [, fillMergedCellsWithVisibleValue [, includeHiddenColumns [, delimiter ] ] ] ] ] ] ] ] ] ] )
Required arguments
srcstring: full path to the file to readfilenamestring: name of the file to download, without the file extension
Optional arguments
columnsstring: specify the columns you want to read as a comma-delimited list of ranges. Each value can be either a single number or a range of numbers with a hyphen, e.g. "1,2-5"columnNamesstring: a comma-delimited list of the names to use for the query columns in the order the columns appear in the spreadsheet. If you specify fewer names than the total number of columns, the remaining column names will be in the form columnX. Note that specifyingcolumnNamesoverrides use of aheaderRowfor column names.headerRownumeric: specify which row is the header to be used for the query column namesrowsstring: specify the rows you want to read as a comma-delimited list of ranges. Each value can be either a single number or a range of numbers with a hyphen, e.g. "1,2-5"sheetNamestring: name of the sheet to read ORsheetNumbernumeric default=1: number of the sheet to read (1 based, not zero-based)includeHeaderRowboolean default=false: whether to include the header row from the spreadsheet (NB: the default is the opposite to Adobe ColdFusion 9, which isexcludeHeaderRow=false).includeBlankRowsboolean default=false: whether to include blank rows from the spreadsheet in the query data set. By default blank rows are suppressed.fillMergedCellsWithVisibleValueboolean default=false: if the source sheet contains merged cells, set the value of each cell in the merged region to the visible value stored in the top/left-most cellincludeHiddenColumnsboolean default=true: if set to false, columns formatted as "hidden" will not be included when reading into a querydelimiterstring default=",": delimiter to use.
Chainable? No.
Example
spreadsheet = New spreadsheet();
filepath = ExpandPath( "report.xls" );
spreadsheet.downloadCsvFromFile( filepath,filename );