Skip to end of banner
Go to start of banner

reporting_addData

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Syntax:

reporting_addData(sheetName, data)

Description:

Adds a number of rows to the Excel worksheet which was set up before with the reporting_setupSheet routine.

There can be more than one call of this routine per reporting script. The writing process takes place in memory only, for the operations to be permanent, a call to the reporting_writeWorkbook routine is mandatory.

Parameters:

Parameter name

Type

Required

Description

sheetName

string

Yes

The worksheet name. The worksheet should have been already set up.

datastring []YesThis is an array of data which will be written to the worksheet. The number of elements must be divisible by the number of elements of the columnTypes array that was used during the sheet setup. If the number is not divisible, an exception will be thrown.

Return type:

The returned value has no meaning.

Examples:

Example 1:

//prior setup of the worksheet
reporting_setupSheet("Data", {"Name", "Position", "Age", "Wage"}, {0, 0, 1, 1});
//construction of the data
string[] data = {"John Doe", "Developer", "30", "1300.50", "Paul Smith", "Project Manager", "41", "2500.00"};
string[] badData = {"John Doe", "Developer", "30", "1300.50", "Paul Smith", "Project Manager", "41", "2500.00", "extra value"};
//actual call of the routine
reporting_addData("Data", data);
//call with mismatching data will throw an exception:
reporting_addData("Data", badData);
  • No labels