-
-
Couldn't load subscription status.
- Fork 39
workbookFromQuery
Julian Halliwell edited this page Nov 11, 2021
·
13 revisions
Returns a workbook object from a query. The query column names are included by default as a bold header row.
workbookFromQuery( data [, addHeaderRow [, boldHeaderRow [, xmlFormat [, streamingXml [, streamingWindowSize [, ignoreQueryColumnDataTypes [, datatypes[, autoSizeColumns ] ] ] ] ] ] ] ] )
-
dataquery: the data you want to download
-
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) -
streamingXmlboolean default=false: whether to create a memory-efficient streaming XML spreadsheet -
streamingWindowSizeinteger 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. -
ignoreQueryColumnDataTypesboolean default=false: whether to ignore the query column data types (e.g.VarChar) and auto-detect each cell type from the value. -
datatypesstruct: specify data types as keys and the columns they should apply to in your data as an array of column names or (positional) numbers. These types will override the query column types or auto-detection where possible. Possible data type keys are:string,numeric,date,time,boolean,auto. See addRows() for examples. -
autoSizeColumnsboolean default=false: whether to adjust the column widths automatically to fit the data added (see Note 1 below).
Chainable? Yes using spreadsheet.newChainable().fromQuery().
- Using
autoSizeColumnswith streaming xlsx workbooks requires a lot of extra processing which can affect performance.
data = QueryNew( "First,Last", "VarChar,VarChar", [ [ "Susi","Sorglos" ], [ "Frumpo","McNugget" ] ] );
spreadsheet = New spreadsheet();
spreadsheetObject = spreadsheet.workbookFromQuery( data );