QScript ExcelWorksheetData

From Q
Jump to navigation Jump to search

ExcelWorksheetData

One worksheet of the Excel workbook that a data file was imported from, with the stored values of its cells. Get one from the worksheets of DataFile.sourceExcelWorkbook.

equals(obj)

Whether two objects are the same.
objThe object to compare against.
Returns:true or false
Example:
data_file.getQuestionByName('Q2').equals(data_file.questions()[0])

getRows(first_row, count)

Gets the cells of the rows of the worksheet as text. A cell holds its stored value, not its formula and not the text its number format shows: a cell that shows 25% returns 0.25. A date or a time is text in the date and time format of the server. A boolean is True or False. The value of a merged range is in its top-left cell.
first_rowThe row number of the first row to get. Rows start at 1, as Excel numbers them. The default is 1.
countThe largest number of rows to get. The default is every row from first_row, which can use a lot of memory for a large worksheet.
Returns:An array with one array of cells for each row, in worksheet order. Row first_row is [0]. A row ends at its last cell with a value, so a row with no value is an empty array. A cell that holds only white space (spaces, tabs or line breaks) does not count as a cell with a value. The array has fewer than count rows only when it ends at row nRows.
Example:
var header_row = worksheet.getRows(1, 1)[0];

name

Gets the name of the worksheet, as it is in the workbook.

nColumns

Gets the number of columns in the worksheet, up to the last column that has a value in any row. 0 for a worksheet with no values.

nRows

Gets the number of rows in the worksheet, which is the row number of its last row that has a value. 0 for a worksheet with no values.

type

Returns the name we use to refer to this class in the documentation.