Skip to content
Julian Halliwell edited this page Nov 13, 2015 · 20 revisions

Adds multiple rows from a query to a spreadsheet.

addRows( workbook, data[, row, column, insert, autoSizeColumns, includeQueryColumnNames ] )

##Required arguments

  • workbook spreadsheet object
  • data query

##Optional arguments

  • row numeric: Row number at which to insert or replace the data. When inserting, existing rows below will be shifted down. If you omit this value, the rows are inserted after the last row in the sheet.
  • column numeric: The column at which to add the row data. Columns to the left of this column will be empty.
  • insert boolean default=true: whether to insert the new data or replace existing values.
  • autoSizeColumns boolean default=false: whether to adjust the column widths automatically to fit the data added.
  • includeQueryColumnNames boolean default=false: whether to include the query column names as the first of the rows being added.

##Example

data = QueryNew( "First,Last","VarChar,VarChar",[ [ "Susi","Sorglos" ],[ "Frumpo","McNugget" ] ] );
spreadsheet = New spreadsheet();
workbook = spreadsheet.new();
spreadsheet.addRows( workbook,data );
Clone this wiki locally