- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 39
writeFileFromQuery
        Julian Halliwell edited this page Aug 12, 2016 
        ·
        10 revisions
      
    Write a spreadsheet file to disk from a query. The query column names are included by default as a bold header row.
writeFileFromQuery( data, filepath [, overwrite [, addHeaderRow [, boldHeaderRow [, xmlFormat ] ] ] ] )
##Required arguments
- 
dataquery: the data you want to download
- 
filepathstring: full path of the file to be written, including filename and extension
##Optional arguments
- 
overwriteboolean default=false: whether or not to overwrite an existing file
- 
addHeaderRowboolean default=true: whether to include the query column names as a header row
- 
boldHeaderRowboolean default=true: whether to make the header row bold
- 
xmlformatboolean default=false: whether to create an XML spreadsheet (.xlsx)
##Example
spreadsheet = New spreadsheet();
data = QueryNew( "First,Last","VarChar,VarChar",[ [ "Susi","Sorglos" ],[ "Frumpo","McNugget] ] );
filepath = ExpandPath( "report.xls" );
spreadsheet.writeFileFromQuery( data,filepath,true );