download - cfsimplicity/spreadsheet-cfml GitHub Wiki

Download an existing workbook object.

download( workbook, filename[, contentType ] )

Required arguments

  • workbook spreadsheet object: the workbook you want to download
  • filename string: name of the file to download, without the file extension

Optional arguments

  • contentType string default="application/msexcel" OR "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": specify to override if you wish, otherwise an appropriate MIME type for the spreadsheet will be used

Chainable? Yes but ends the chain.

Example

spreadsheet = New spreadsheet();
data = QueryNew( "First,Last","VarChar,VarChar",[ [ "Susi","Sorglos" ],[ "Frumpo","McNugget" ] ] );
workbook = spreadsheet.workbookFromQuery( data );
filename = "report";
spreadsheet.download( workbook,filename );