TSService.addCalculatedRow

Syntax

addCalculatedRow (wbk, metaData, callback);

Parameters

wbk. Sets workbook value.

metaData. Defines workbook metadata that include information on added calculated series.

callback. Sets handler for operation execution end.

Description

The addCalculatedRow method adds calculated series.

Example

To execute the example, the page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), and also add the following code in the handler, that processes document opening event:

	metabase.EndRequest.add(function addCalcRow(){				
	var source = workbookBox.getSource();//return an instance of the PP.TS.Workbook class
	//Get selected series
	var selectedRows = source.getSelectedSeries();					
	var metaData = {"formulaType": "TransformLead", "index": 2, "selectedRows" : selectedRows, "serieFlags": 24}
	var typeUpdateData = new Array();
	typeUpdateData.push("AddCalculateSeries");
	typeUpdateData.push("Chart");
	typeUpdateData.push("Map");					
	var args = new PP.Mb.Ui.PropertyChangedEventArgs(
	{
		PropertyName: "Formulas",
		TypeUpdateData: typeUpdateData,
		Metadata: metaData
	});	
	//Add calculated series
	tsService.addCalculatedRow(source, args, function()
	{
		metabase.EndRequest.remove(addCalcRow);
		workbookBox.refreshAll();
		});			
	});

After executing the example the WorkbookBox component is placed on the HTML page and a new calculated series is added to the workbook table.

See also:

TSService