Skip to content


Julian Halliwell edited this page Dec 22, 2018 · 6 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 [, streamingXml [, streamingWindowSize  ] ] ] ] ] ] )

Required arguments

  • data query: the data you want to download
  • filepath string: full path of the file to be written, including filename and extension

Optional arguments

  • overwrite boolean default=false: whether or not to overwrite an existing file
  • addHeaderRow boolean default=true: whether to include the query column names as a header row
  • boldHeaderRow boolean default=true: whether to make the header row bold
  • xmlformat boolean default=false: whether to create an XML spreadsheet (.xlsx)
  • (Version 2+)streamingXml boolean default=false: whether to create a memory-efficient streaming XML spreadsheet
  • (Version 2+)streamingWindowSize integer default=100: (positive integer greater than 0) the maximum number of rows that are kept in memory at once while populating a streaming spreadsheet, before being flushed to disk.


spreadsheet = New spreadsheet();
data = QueryNew( "First,Last", "VarChar,VarChar", [ [ "Susi","Sorglos" ], [ "Frumpo","McNugget] ] );
filepath = ExpandPath( "report.xls" );
spreadsheet.writeFileFromQuery( data, filepath, true );
You can’t perform that action at this time.