PackageTop Level
Classpublic class FlexPivotComponent
InheritanceFlexPivotComponent Inheritance mx.containers.Canvas



Public Properties
 PropertyDefined By
  alertFunction : Function
[write-only] Sets custom function for alert.
FlexPivotComponent
  componentFolder : String
[write-only] The componentFolder property defines the path to the component's folder which contains all necessary files.
FlexPivotComponent
  configUrl : String
[write-only] The configUrl property lets you define a URL of the configuration XML file.
FlexPivotComponent
  gridColumnCount : int
[read-only] Returns a number of active columns in the grid.
FlexPivotComponent
  gridRowCount : int
[read-only] Returns a number of active rows in the grid.
FlexPivotComponent
  licenseFilePath : String
[write-only] The licenseFilePath property lets you define the path the TXT file with the license key.
FlexPivotComponent
  licenseKey : String
[write-only] The licenseKey property lets you set the license key.
FlexPivotComponent
  preloaderFunction : Function
[write-only] Sets custom function for preloader.
FlexPivotComponent
  productKey : String
Deprecated Since version 1.6: Please Use licenseKey
[write-only]
FlexPivotComponent
  swfFilePath : String
Deprecated Since version 1.6: Please Use componentFolder
[write-only]
FlexPivotComponent
  useExternalFieldsView : Boolean
[write-only]
FlexPivotComponent
  useExternalFilterView : Boolean
[write-only]
FlexPivotComponent
  useLocalStorage : Boolean
[write-only]
FlexPivotComponent
Public Methods
 MethodDefined By
  
Constructor.
FlexPivotComponent
  
Adds conditional formatting rule for cell values to format them with specific styles if the condition for the cell value is met.
FlexPivotComponent
  
addDataArray(array:Array):void
Deprecated Since version 2.2: Please Use addJSON()
Adds new data records from array.
FlexPivotComponent
  
addDataRecord(object:Object):void
Deprecated Since version 2.2: Please Use addJSON()
Adds new data record from object.
FlexPivotComponent
  
Deprecated Since version 2.2: Please Use addJSON()
Adds new dimension to the data structure.
FlexPivotComponent
  
Deprecated Since version 2.2: Please Use addJSON()
Adds new hierarchy to the specified dimension.
FlexPivotComponent
  
addJSON(json:Array):void
Sets JSON data source.
FlexPivotComponent
  
Deprecated in 2.2 for adding new measure to the data structure.
FlexPivotComponent
  
addStyleToMember(hierarchyName:String, memberName:String, style:StyleValueObject):void
Applies style to the member of specific hierarchy.
FlexPivotComponent
  
addUrlToMember(hierarchyName:String, memberName:String, url:String):void
Adds link to the member of specific hierarchy.
FlexPivotComponent
  
clear():void
Clears the component's data and view.
FlexPivotComponent
  
clearFilter(hierarchyName:String):void
Clears the filter which was applied previously to the specified hierarchy.
FlexPivotComponent
  
Closes Fields List.
FlexPivotComponent
  
Collapses all nodes and drills up (starting from v2.1) all levels of all hierarchies in slice on the grid and on charts.
FlexPivotComponent
  
collapseData(hierarchyName:String):void
Collapses all nodes of the specified hierarchy.
FlexPivotComponent
  
connectTo(params:ConnectionParams, callbackHandler:Function = null):void
Connects the component to the specified data source.
FlexPivotComponent
  
Deprecated Since version 1.8
FlexPivotComponent
  
expandAllData(withAllChildren:Boolean = true):void
Expands all nodes and drills down all levels of all hierarchies in slice on the grid and on charts.
FlexPivotComponent
  
expandData(hierarchyName:String):void
Expands all nodes of the specified hierarchy.
FlexPivotComponent
  
export(type:String, exportOptions:ExportOptions = null, callbackHandler:Function = null):void
Exports grid or chart to CSV, HTML, PDF, Image or Excel format.
FlexPivotComponent
  
Returns a list of conditional formatting rules of the report.
FlexPivotComponent
  
Returns a list of all available hierarchies.
FlexPivotComponent
  
Returns a list of all available measures.
FlexPivotComponent
  
getCell(rowIdx:int, colIdx:int):PivotGridCell
Returns information about cell by row and column indexes.
FlexPivotComponent
  
getColumns():Array
Returns a list of hierarchies in the "Columns" axis.
FlexPivotComponent
  
getColumnWidth(colIdx:int):int
Returns specified column's width.
FlexPivotComponent
  
Returns a conditional formatting rule by id.
FlexPivotComponent
  
getFilter(hierarchyName:String):Array
Returns the filtered members for the specified hierarchy.
FlexPivotComponent
  
getFilterProperties(hierarchyName:String):Object
Returns the filter properties set for the specified hierarchy.
FlexPivotComponent
  
getFormat(measureName:String):FormatValueObject
Returns the number formatting for the specified measure.
FlexPivotComponent
  
Returns an object which represents current localization.
FlexPivotComponent
  
getMeasures():Array
Returns a list of the selected measures in the report.
FlexPivotComponent
  
getMembers(hierarchyName:String, memberName:String, callbackHandler:Function = null):Array
Returns a list of members for the specified hierarchy.
FlexPivotComponent
  
Returns an OptionsValueObject with component's options.
FlexPivotComponent
  
getPages():Array
Returns a list of hierarchies in the "Pages" ("Report Filter") axis.
FlexPivotComponent
  
Returns an object which describes the current report.
FlexPivotComponent
  
getRowHeight(rowIdx:int):int
Returns row's height with specified index.
FlexPivotComponent
  
getRows():Array
Returns a list of hierarchies in the "Rows" axis.
FlexPivotComponent
  
Returns information about selected cell.
FlexPivotComponent
  
getSort(hierarchyName:String):String
Returns the sort type which is applied to the hierarchy.
FlexPivotComponent
  
getValue(rowIdx:int, colIdx:int):Number
Returns the cell value by row and column indexes.
FlexPivotComponent
  
getXMLACatalogs(proxyURL:String, dataSource:String, callbackHandler:Function, username:String = null, password:String = null):void
One of four API calls of OLAP/XMLA connectivity diagnostics.
FlexPivotComponent
  
getXMLACubes(proxyURL:String, dataSource:String, catalog:String, callbackHandler:Function, username:String = null, password:String = null):void
One of four API calls of OLAP/XMLA connectivity diagnostics.
FlexPivotComponent
  
getXMLADataSources(proxyURL:String, callbackHandler:Function, username:String = null, password:String = null):void
One of four API calls of OLAP/XMLA connectivity diagnostics.
FlexPivotComponent
  
getXMLAProviderName(proxyURL:String, callbackHandler:Function, username:String = null, password:String = null):String
One of four API calls of OLAP/XMLA connectivity diagnostics.
FlexPivotComponent
  
load(param:*):void
Loads report from the specified URL.
FlexPivotComponent
  
open():void
Opens local report file.
FlexPivotComponent
  
Opens Fields List.
FlexPivotComponent
  
percentZoom(value:Number):void
Zooms grid in percentage.
FlexPivotComponent
  
print():void
Prints the content of the grid or chart via OS print manager.
FlexPivotComponent
  
refresh():void
Redraws the component.
FlexPivotComponent
  
Removes all conditional formatting rules.
FlexPivotComponent
  
Please note that this feature is available only for reports based on CSV data source.
FlexPivotComponent
  
removeCondition(id:String):void
Removes the conditional formatting rule by id.
FlexPivotComponent
  
removeMeasure(uniqueName:String):void
Please note that this feature is available only for reports based on CSV data source.
FlexPivotComponent
  
Removes selection on the grid
FlexPivotComponent
  
runQuery(slice:Object):void
Runs a query with specified slice and displays the result data.
FlexPivotComponent
  
save(filename:String, destinationType:String, callbackHandler:Function = null, url:String, embedData:Boolean = false):void
Saves a report.
FlexPivotComponent
  
setBottomX(hierarchyName:String, num:int, measureName:String):void
Sets the Bottom X filter for the specified hierarchy and measure.
FlexPivotComponent
  
setChartTitle(value:String):void
Sets the title for charts in run time.
FlexPivotComponent
  
setColumnWidth(colIdx:int, width:int):void
Sets the width of the specified column.
FlexPivotComponent
  
setFilter(hierarchyName:String, items:Array, negation:Boolean = false):void
Sets the filter for the specified hierarchy.
FlexPivotComponent
  
setFormat(format:FormatValueObject, measureName:String):void
Sets a number formatting for the specified measure.
FlexPivotComponent
  
setGridTitle(value:String):void
Sets the title for grid in run time.
FlexPivotComponent
  
Applies new values to localized labels.
FlexPivotComponent
  
Sets the component's options.
FlexPivotComponent
  
Sets a report to be displayed in the component.
FlexPivotComponent
  
setRowHeight(rowIdx:int, height:int):void
Sets height of the specified row.
FlexPivotComponent
  
setSelectedCell(rowIdx:int, colIdx:int):void
Sets the selection for the cell by row's and column's indexes.
FlexPivotComponent
  
setSort(hierarchyName:String, sortType:String):void
Sets the sort type to the specified hierarchy.
FlexPivotComponent
  
setStyleSheet(value:*):void
Loads a style sheet from the specified URL and applies it to the component.
FlexPivotComponent
  
setTopX(hierarchyName:String, num:int, measureName:String):void
Sets the Top X filter for the specified hierarchy and measure.
FlexPivotComponent
  
showCharts(type:String, multiple:Boolean = false):void
Switches to the charts view and shows the chart of the specified type.
FlexPivotComponent
  
showGrid():void
Switches to the grid view.
FlexPivotComponent
  
showGridAndCharts(type:String, multiple:Boolean = false):void
Switches to the grid and charts view and shows the chart of the specified type.
FlexPivotComponent
  
sortValues(axisName:String, type:String, tuple:Array, measureName:String):void
Sorts values of the specified axis and measure.
FlexPivotComponent
  
updateData(array:Array):void
FlexPivotComponent
  
zoom(value:Number):void
Zooms grid to the specified value.
FlexPivotComponent
Events
 Event Summary Defined By
  Dispatched when the pivot component creation is complete but data structure is still loading.FlexPivotComponent
  Dispatched when fields list is closed.FlexPivotComponent
  Dispatched when fields list is opened.FlexPivotComponent
  Dispatched when useExternalFilterView property has a true value and a filter icon is pressed.FlexPivotComponent
  Dispatched when a user presses and releases the main button of a pointing device over the defined grid cell.FlexPivotComponent
  Dispatched when a user presses and releases the main button of a pointing device twice in rapid succession over the same grid cell.FlexPivotComponent
  Dispatched when the report is changed.FlexPivotComponent
  Dispatched when the report is loaded.FlexPivotComponent
  Dispatched when the component loaded data, updated data slice, filter or sort.FlexPivotComponent
Property Detail
alertFunctionproperty
alertFunction:Function  [write-only]

Sets custom function for alert.


Implementation
    public function set alertFunction(value:Function):void
componentFolderproperty 
componentFolder:String  [write-only]

The componentFolder property defines the path to the component's folder which contains all necessary files.

It is used as base URL for configuration files, localization files, styles and images. If resource files are not located in root directory, specify the path to them. It's very important to set this parameter correctly.

The default value is "".


Implementation
    public function set componentFolder(value:String):void
configUrlproperty 
configUrl:String  [write-only]

The configUrl property lets you define a URL of the configuration XML file. The configUrl property is used when you set the component configuration via XML.

Note: After setting this parameter, FlexPivotComponent will ignore the previous configuration.

There is no default value for this property.


Implementation
    public function set configUrl(value:String):void

Example
             <pivot:FlexPivotComponent configUrl="config.xml" />
             
gridColumnCountproperty 
gridColumnCount:int  [read-only]

Returns a number of active columns in the grid.


Implementation
    public function get gridColumnCount():int

See also

gridRowCountproperty 
gridRowCount:int  [read-only]

Returns a number of active rows in the grid.


Implementation
    public function get gridRowCount():int

See also

licenseFilePathproperty 
licenseFilePath:String  [write-only]

The licenseFilePath property lets you define the path the TXT file with the license key.

The licenseKey property is the alternative way to set the license key.

The default value is null.


Implementation
    public function set licenseFilePath(value:String):void

See also

licenseKeyproperty 
licenseKey:String  [write-only]

The licenseKey property lets you set the license key.

The licenseFilePath property is the alternative way to set the license key.

The default value is null.


Implementation
    public function set licenseKey(value:String):void
preloaderFunctionproperty 
preloaderFunction:Function  [write-only]

Sets custom function for preloader.


Implementation
    public function set preloaderFunction(value:Function):void
productKeyproperty 
productKey:String  [write-only]
Deprecated Since version 1.6: Please Use licenseKey


Implementation
    public function set productKey(value:String):void
swfFilePathproperty 
swfFilePath:String  [write-only]
Deprecated Since version 1.6: Please Use componentFolder


Implementation
    public function set swfFilePath(value:String):void
useExternalFieldsViewproperty 
useExternalFieldsView:Boolean  [write-only]


Implementation
    public function set useExternalFieldsView(value:Boolean):void
useExternalFilterViewproperty 
useExternalFilterView:Boolean  [write-only]


Implementation
    public function set useExternalFilterView(value:Boolean):void
useLocalStorageproperty 
useLocalStorage:Boolean  [write-only]


Implementation
    public function set useLocalStorage(value:Boolean):void
Constructor Detail
FlexPivotComponent()Constructor
public function FlexPivotComponent()

Constructor.

Method Detail
addCondition()method
public function addCondition(condition:ConditionValueObject):void

Adds conditional formatting rule for cell values to format them with specific styles if the condition for the cell value is met.

You can create as much conditions with different formatting for one report as you need, there is no limit towards the number of conditions. If there are more than one conditional formatting rules for the report, they will be applied one by one in the order they have been created.

The conditional formatting may be added to all pivot table cells, to the cell specifying row and column indexes, to totals and sub-totals only, to regular cells only, or to the cells of selected measure, hierarchy, and hierarchy's member. All these parameters can be specified in rule object.

Use refresh() API call after to redraw the component and see changes.

When you save the report all the conditional formatting will be saved as well and loaded when report is retrieved.

Parameters

condition:ConditionValueObject — ConditionValueObject that describes the conditional formatting rule.

See also


Example
If cell value is more than 100, then apply trueStyle to this cell:
             var trueStyle: StyleValueObject = new StyleValueObject();
             trueStyle.fontSize = 13;
             trueStyle.backgroundColor = 0x33BB33;
             var condition:ConditionValueObject = new ConditionValueObject('if(#value > 100, "trueStyle")', trueStyle);
             condition.id = 1; 
             pivot.addCondition(condition);
             pivot.refresh();
             
This rule will be applied only to Sales measure totals and sub-totals cells. If Sales is between 100000 and 200000, then apply trueStyle to the cell, else apply false style.
             var trueStyle: StyleValueObject = new StyleValueObject();
             trueStyle.fontSize = 11;
             trueStyle.fontWeight = "bold";
             trueStyle.backgroundColor = 0x00FF00;
             var condition:ConditionValueObject = new ConditionValueObject('if(AND(#value > 100000, #value < 200000), "trueStyle", "falseStyle")',trueStyle);
             condtion.id = 2;
             condtion.measure = "[Measures].[Sales]";
             condtion.isTotal = true;
             var falseStyle: StyleValueObject = new StyleValueObject();
             falseStyle.fontSize = 11;
             falseStyle.color = 0x000000;
             condition.falseStyle = falseStyle;
             pivot.addCondition(condition);
             pivot.refresh();
             
addDataArray()method 
public function addDataArray(array:Array):void
Deprecated Since version 2.2: Please Use addJSON()

Adds new data records from array.

Parameters

array:Array — the multidimensional array that describes a set of data records. The order of elements in each subarray must be the same as in previously defined data structure.

See also


Example
To add a set of data records first define data structure and then use addDataArray(), as follows:
             //first add some dimension
             pivot.addDimension(new DimensionValueObject("[Product]", "Product"));
                
             //now hierarchy can be added to previously created dimension                
             pivot.addHierarchy(new HierarchyValueObject("[Product]", "[Product].[Color]", "Color h", SortType.DESC));
             pivot.addHierarchy(new HierarchyValueObject("[Product]", "[Product].[Style]", "Style"));
             
             //now measures can be added
             pivot.addMeasure(new MeasureValueObject("[Measures].[Price]", "Price"));
             pivot.addMeasure(new MeasureValueObject("[Measures].[Discount]", "Discount", AggregationName.AVERAGE));
             
             //then add several data records
             //using addDataRecord
             pivot.addDataRecord({"[Product].[Color]" : "red", "[Product].[Style]" : "classic", "[Measures].[Price]" : 12, "[Measures].[Discount]" : 3});
             pivot.addDataRecord({"[Product].[Color]" : "blue", "[Product].[Style]" : "classic", "[Measures].[Price]" : 13, "[Measures].[Discount]" : 2});
             pivot.addDataRecord({"[Product].[Color]" : "white", "[Product].[Style]" : "sport", "[Measures].[Price]" : 44, "[Measures].[Discount]" : 6});
             pivot.addDataRecord({"[Product].[Color]" : "red", "[Product].[Style]" : "modern", "[Measures].[Price]" : 15, "[Measures].[Discount]" : 3});
             //or using addDataArray
             pivot.addDataArray([
                         ["yellow", "modern", 10, 0],
                         ["yellow", "classic", 13, 3],
                         ["yellow", "sport", 30, 0]
                     ]);
             
             //when the data is passed to the component and you want to see them, call refresh()
             pivot.refresh();
             //the fields list will be opened where you can arrange what data you want to see in rows and in columns
             
             //or you can define a slice (rows, columns, measures) via API using runQuery()
             var slice:Object = 
             {
                 rows: 
                 [
                     {uniqueName: "[Product].[Color]"},
                     {uniqueName: "[Measures]"}
                 ],
                 columns: 
                 [
                     {uniqueName: "[Product].[Style]"}
                 ],
                 measures:
                 [
                     {uniqueName: "[Measures].[Price]"}
                 ]
             };
             pivot.runQuery(slice);
             
addDataRecord()method 
public function addDataRecord(object:Object):void
Deprecated Since version 2.2: Please Use addJSON()

Adds new data record from object.

Parameters

object:Object — the object that describes data record. Names of properties must correspond with the unique names of hierarchies and measures in previously defined data structure.

See also


Example
To add data record first define data structure and then use addDataRecord(), as follows:
             //first add some dimension
             pivot.addDimension(new DimensionValueObject("[Product]", "Product"));                
             //now hierarchy can be added to previously created dimension                
             pivot.addHierarchy(new HierarchyValueObject("[Product]", "[Product].[Color]", "Color h", SortType.DESC));
             pivot.addHierarchy(new HierarchyValueObject("[Product]", "[Product].[Style]", "Style"));
             
             //now measures can be added
             pivot.addMeasure(new MeasureValueObject("[Measures].[Price]", "Price"));
             pivot.addMeasure(new MeasureValueObject("[Measures].[Discount]", "Discount", AggregationName.AVERAGE));
             
             //then add several data records
             //using addDataRecord
             pivot.addDataRecord({"[Product].[Color]" : "red", "[Product].[Style]" : "classic", "[Measures].[Price]" : 12, "[Measures].[Discount]" : 3});
             pivot.addDataRecord({"[Product].[Color]" : "blue", "[Product].[Style]" : "classic", "[Measures].[Price]" : 13, "[Measures].[Discount]" : 2});
             pivot.addDataRecord({"[Product].[Color]" : "white", "[Product].[Style]" : "sport", "[Measures].[Price]" : 44, "[Measures].[Discount]" : 6});
             pivot.addDataRecord({"[Product].[Color]" : "red", "[Product].[Style]" : "modern", "[Measures].[Price]" : 15, "[Measures].[Discount]" : 3});
             //or using addDataArray
             pivot.addDataArray([
                         ["yellow", "modern", 10, 0],
                         ["yellow", "classic", 13, 3],
                         ["yellow", "sport", 30, 0]
                     ]);
             
             //when the data is passed to the component and you want to see them, call refresh()
             pivot.refresh();
             //the fields list will be opened where you can arrange what data you want to see in rows and in columns
             
             //or you can define a slice (rows, columns, measures) via API using runQuery()
             var slice:Object = 
             {
                 rows: 
                 [
                     {uniqueName: "[Product].[Color]"},
                     {uniqueName: "[Measures]"}
                 ],
                 columns: 
                 [
                     {uniqueName: "[Product].[Style]"}
                 ],
                 measures:
                 [
                     {uniqueName: "[Measures].[Price]"}
                 ]
             };
             pivot.runQuery(slice);
             
addDimension()method 
public function addDimension(dimension:DimensionValueObject):void
Deprecated Since version 2.2: Please Use addJSON()

Adds new dimension to the data structure.

Parameters

dimension:DimensionValueObject — DimensionValueObject that describes dimension.

See also


Example
To add new dimension to the data structure use addDimension(), as follows:
             //first add some dimension
             pivot.addDimension(new DimensionValueObject("[Product]", "Product"));
                
             //now hierarchy can be added to previously created dimension                
             pivot.addHierarchy(new HierarchyValueObject("[Product]", "[Product].[Color]", "Color h", SortType.DESC));
             pivot.addHierarchy(new HierarchyValueObject("[Product]", "[Product].[Style]", "Style"));
             
             //now measures can be added
             pivot.addMeasure(new MeasureValueObject("[Measures].[Price]", "Price"));
             pivot.addMeasure(new MeasureValueObject("[Measures].[Discount]", "Discount", AggregationName.AVERAGE));
             
             //then add several data records
             //using addDataRecord
             pivot.addDataRecord({"[Product].[Color]" : "red", "[Product].[Style]" : "classic", "[Measures].[Price]" : 12, "[Measures].[Discount]" : 3});
             pivot.addDataRecord({"[Product].[Color]" : "blue", "[Product].[Style]" : "classic", "[Measures].[Price]" : 13, "[Measures].[Discount]" : 2});
             pivot.addDataRecord({"[Product].[Color]" : "white", "[Product].[Style]" : "sport", "[Measures].[Price]" : 44, "[Measures].[Discount]" : 6});
             pivot.addDataRecord({"[Product].[Color]" : "red", "[Product].[Style]" : "modern", "[Measures].[Price]" : 15, "[Measures].[Discount]" : 3});
             //or using addDataArray
             pivot.addDataArray([
                         ["yellow", "modern", 10, 0],
                         ["yellow", "classic", 13, 3],
                         ["yellow", "sport", 30, 0]
                     ]);
             
             //when the data is passed to the component and you want to see them, call refresh()
             pivot.refresh();
             //the fields list will be opened where you can arrange what data you want to see in rows and in columns
             
             //or you can define a slice (rows, columns, measures) via API using runQuery()
             var slice:Object = 
             {
                 rows: 
                 [
                     {uniqueName: "[Product].[Color]"},
                     {uniqueName: "[Measures]"}
                 ],
                 columns: 
                 [
                     {uniqueName: "[Product].[Style]"}
                 ],
                 measures:
                 [
                     {uniqueName: "[Measures].[Price]"}
                 ]
             };
             pivot.runQuery(slice);
             
addHierarchy()method 
public function addHierarchy(hierarchy:HierarchyValueObject):void
Deprecated Since version 2.2: Please Use addJSON()

Adds new hierarchy to the specified dimension.

Parameters

hierarchy:HierarchyValueObject — HierarchyValueObject that describes hierarchy.

See also


Example
To add new hierarchies to the data structure use addHierarchy(), as follows:
             //first add some dimension
             pivot.addDimension(new DimensionValueObject("[Product]", "Product"));
                
             //now hierarchy can be added to previously created dimension                
             pivot.addHierarchy(new HierarchyValueObject("[Product]", "[Product].[Color]", "Color h", SortType.DESC));
             pivot.addHierarchy(new HierarchyValueObject("[Product]", "[Product].[Style]", "Style"));
             
             //now measures can be added
             pivot.addMeasure(new MeasureValueObject("[Measures].[Price]", "Price"));
             pivot.addMeasure(new MeasureValueObject("[Measures].[Discount]", "Discount", AggregationName.AVERAGE));
             
             //then add several data records
             //using addDataRecord
             pivot.addDataRecord({"[Product].[Color]" : "red", "[Product].[Style]" : "classic", "[Measures].[Price]" : 12, "[Measures].[Discount]" : 3});
             pivot.addDataRecord({"[Product].[Color]" : "blue", "[Product].[Style]" : "classic", "[Measures].[Price]" : 13, "[Measures].[Discount]" : 2});
             pivot.addDataRecord({"[Product].[Color]" : "white", "[Product].[Style]" : "sport", "[Measures].[Price]" : 44, "[Measures].[Discount]" : 6});
             pivot.addDataRecord({"[Product].[Color]" : "red", "[Product].[Style]" : "modern", "[Measures].[Price]" : 15, "[Measures].[Discount]" : 3});
             //or using addDataArray
             pivot.addDataArray([
                         ["yellow", "modern", 10, 0],
                         ["yellow", "classic", 13, 3],
                         ["yellow", "sport", 30, 0]
                     ]);
             
             //when the data is passed to the component and you want to see them, call refresh()
             pivot.refresh();
             //the fields list will be opened where you can arrange what data you want to see in rows and in columns
             
             //or you can define a slice (rows, columns, measures) via API using runQuery()
             var slice:Object = 
             {
                 rows: 
                 [
                     {uniqueName: "[Product].[Color]"},
                     {uniqueName: "[Measures]"}
                 ],
                 columns: 
                 [
                     {uniqueName: "[Product].[Style]"}
                 ],
                 measures:
                 [
                     {uniqueName: "[Measures].[Price]"}
                 ]
             };
             pivot.runQuery(slice);
             
addJSON()method 
public function addJSON(json:Array):void

Sets JSON data source.

Parameters

json:Array — of objects. The component supports a certain format of JSON - array of objects, where each object is an unordered set of name/value pairs. In addition, the first object can be used to define data types, captions, etc. Here is the list of supported properties that can be used in the first object of input array:
  • type - data type. Can be:
    • "string" - field contains string data. You will be able to aggregate it only with Count and Distinct Count aggregations. It will be sorted as string data.
    • "number" - field contains numeric data. You will be able to aggregate it with all different aggregations. It will be sorted as numeric data.
    • "boolean"
    • "level" - field is a level of hierarchy. This type is used together with other properties such as: hierarchy, level and parent
    • "month" - field contains months.
    • "weekday" - field contains days of the week.
    • "date" - field is a date. Such field will be split into 3 different fields: Year, Month, Day.
    • "date string" - field is a date. Such field will be formatted using date pattern (default is MM/DD/YYYY).
    • "year/month/day" - field is a date. You will see such date as a hierarchy: Year > Month > Day.
    • "year/quarter/month/day" - field is a date. You will see such date as a hierarchy: Year > Quarter > Month > Day.
    • "time" - field is a time (numeric data). Such field will be formatted using HH:MM pattern. Min, Max, Count and Distinct Count aggregations can be applied to it.
    • "datetime" - field is a date (numeric data). Such field will be formatted using MM/DD/YYYY HH:MM pattern. Min, Max, Count and Distinct Count aggregations can be applied to it.
    • "id" - field is an id of the fact. Such field is used for editing data. This field will not be shown in Fields List.
    • "hidden" - field is hidden. This field will not be shown in Fields List.
  • caption - hierarchy caption.
  • hierarchy - hierarchy name, if the field is a level of hierarchy ("type":"level").
  • level - caption of the level, if the field is a level of hierarchy ("type":"level").
  • parent - caption of the parent level, if the field is a level of hierarchy ("type":"level").
  • dimensionUniqueName - dimension unique name. Can be used to group several fields under one dimension.
  • dimensionCaption - dimension caption. Is used as a display name (folder name in Fields List) when several fields are grouped under one dimension.


Example
To add JSON data using addJSON() API call. Please pay your attention that the first element of JSON in this example is used to define data types, captions, group fields under one dimension, define hierarchy with 3 levels.
                 <fx:Script>
                 <![CDATA[
                         private var jsonData:Array = [
                             {
                                 "Color":{"type": "string"},
                                 "M":{"type": "month", "dimensionUniqueName": "Days", "dimensionCaption": "Days", "caption":"Month"},
                                 "W":{"type": "weekday", "dimensionUniqueName": "Days", "dimensionCaption": "Days", "caption":"Week Day"},
                                 "country":{"type":"level", "hierarchy": "Geography", "level":"Country"},
                                 "state":{"type":"level", "hierarchy": "Geography", "level":"State", "parent": "Country"},
                                 "city":{"type":"level", "hierarchy": "Geography", "parent": "State"},
                                 "Price":0,
                                 "Quantity":{"type": "number"}
                             },
                             {
                                 "Color":"green",
                                 "M":"September",
                                 "W":"Wed",
                                 "country" : "Canada",
                                 "state" : "Ontario",
                                 "city" : "Toronto",
                                 "Price":174,
                                 "Quantity":22
                             },
                             {
                                 "Color":"red",
                                 "M":"March",
                                 "W":"Mon",
                                 "Time":"1000",
                                 "country" : "USA",
                                 "state" : "California",
                                 "city" : "Los Angeles",
                                 "Price":1664,
                                 "Quantity":19
                             },
                             {
                                 "Color":"red",
                                 "M":"January",
                                 "W":"Mon",
                                 "country" : "Canada",
                                 "state" : "Quebec",
                                 "city" : "Montreal",
                                 "Price":1190,
                                 "Quantity":292
                             },
                             {
                                 "Color":"green",
                                 "D":"04/08/2014",
                                 "M":"August",
                                 "W":"Fri",
                                 "Time":"1000",
                                 "country" : "USA",
                                 "state" : "California",
                                 "city" : "Los Angeles",
                                 "Price":1222,
                                 "Quantity":730
                             },
                             {
                                 "Color":"white",
                                 "M":"March",
                                 "W":"Wed",
                                 "country" : "USA",
                                 "state" : "California",
                                 "city" : "Los Angeles",
                                 "Price":7941,
                                 "Quantity":73
                             },
                             {
                                 "Color":"red",
                                 "M":"August",
                                 "W":"Wed",
                                 "country" : "Canada",
                                 "state" : "Ontario",
                                 "city" : "Toronto",
                                 "Price":6829,
                                 "Quantity":19
                             },
                             {
                                 "Color":"green",
                                 "M":"January",
                                 "W":"Wed",
                                 "country" : "Canada",
                                 "state" : "Quebec",
                                 "city" : "Montreal",
                                 "Price":2995,
                                 "Quantity":98
                             },
                             {
                                 "Color":"white",
                                 "M":"February",
                                 "W":"Mon",
                                 "country" : "USA",
                                 "state" : "California",
                                 "city" : "Los Angeles",
                                 "Price":2471,
                                 "Quantity":93
                             },
                             {
                                 "Color":"yellow",
                                 "M":"March",
                                 "W":"Fri",
                                 "country" : "Canada",
                                 "state" : "Ontario",
                                 "city" : "Toronto",
                                 "Price":6650,
                                 "Quantity":40
                             },
                             {
                                 "Color":"blue",
                                 "M":"February",
                                 "W":"Wed",
                                 "country" : "Canada",
                                 "state" : "Ontario",
                                 "city" : "Toronto",
                                 "Price":865,
                                 "Quantity":45
                             },
                             {
                                 "Color":"purple",
                                 "M":"August",
                                 "W":"Wed",
                                 "country" : "Canada",
                                 "state" : "Quebec",
                                 "city" : "Montreal",
                                 "Price":511,
                                 "Quantity":46
                             },
                             {
                                 "Color":"blue",
                                 "M":"September",
                                 "W":"Mon",
                                 "country" : "Canada",
                                 "state" : "Quebec",
                                 "city" : "Montreal",
                                 "Price":981,
                                 "Quantity":18
                             },
                             {
                                 "Color":"blue",
                                 "M":"September",
                                 "W":"Fri",
                                 "country" : "Canada",
                                 "state" : "Ontario",
                                 "city" : "Toronto",
                                 "Price":284,
                                 "Quantity":24
                             }
                         ];
             
                         protected function onPivotCreationComplete(event:FlexEvent):void {
                             this.flexmonsterAddJSON();
                         }
             
                         private function flexmonsterAddJSON() {
                             flexmonster.addJSON(jsonData);
                             var slice:Object = 
                                 {
                                     rows: 
                                     [
                                         { uniqueName: "Color" }
                                     ],
                                     columns: 
                                     [
                                         { uniqueName: "W" }, 
                                         { uniqueName: "[Measures]" }
                                     ],
                                     measures: 
                                     [
                                         { uniqueName: "Price"}
                                     ]};
                             flexmonster.runQuery(slice);
                         }
                     ]]>
                 </fx:Script>
                 <pivot:FlexPivotComponent id="flexmonster" width="100%" height="100%" 
                                     componentFolder="flexmonster/"
                                     creationComplete="onPivotCreationComplete(event)"/>
             
To add JSON data using setReport() API call:
                 <fx:Script>
                 <![CDATA[
                         protected function onPivotCreationComplete(event:FlexEvent):void {
                             this.flexmonsterSetReport();
                         }
             
                         private function flexmonsterSetReport():void {
                             var report:ReportValueObject = new ReportValueObject();
                             report.dataSourceType = DataSourceType.JSON;
                             report.data = jsonData;
                             report.rows = [
                                 { uniqueName: "M" }
                             ];
                             report.columns = [
                                 { uniqueName: "Geography" }, 
                                 { uniqueName: "[Measures]" }
                             ];
                             report.measures = [
                                 { uniqueName: "Quantity"}
                             ];
                             report.configuratorActive = true;
                             report.viewType = ViewType.GRID;
                             flexmonster.setReport(report);
                         }
                     ]]>
                 </fx:Script>
                 <pivot:FlexPivotComponent id="flexmonster" width="100%" height="100%" 
                                     componentFolder="flexmonster/"
                                     creationComplete="onPivotCreationComplete(event)"/>
             
Open local JSON file:
                     var params:ConnectionParams = new ConnectionParams();
                     params.dataSourceType = DataSourceType.JSON;
                     params.browseForFile = true;
                     flexmonster.connectTo(params);
             
Connect to remote JSON file:
                     var params:ConnectionParams = new ConnectionParams();
                     params.dataSourceType = DataSourceType.JSON;
                     params.filename = "http://www.flexmonster.com/download/jsondata.js";
                     flexmonster.connectTo(params);
             
addMeasure()method 
public function addMeasure(measure:MeasureValueObject):void

Deprecated in 2.2 for adding new measure to the data structure. We strongly recommend you using JSON.

Adds new measure to the data structure and adds calculated measure.

Use this method to add new measure to the data structure if you create data struture dynamically via API calls such as addDimension(), addHierarchy(), addDataRecord() and addDataArray().

This method can be used to add calculated measure. Calculated measure has formula property. You can create as much calculated measures for one report as you need, there is no limit towards the number of calculated measures. When you save the report all the calculated measures will be saved as well and loaded when report is retrieved. Please note that you can add calculated measures only for reports based on CSV data source.

Parameters

measure:MeasureValueObject — MeasureValueObject that describes measure.

See also


Example
To add measure to the data structure use addMeasure(), as follows:
             //first add some dimension
             pivot.addDimension(new DimensionValueObject("[Product]", "Product"));
                
             //now hierarchy can be added to previously created dimension                
             pivot.addHierarchy(new HierarchyValueObject("[Product]", "[Product].[Color]", "Color h", SortType.DESC));
             pivot.addHierarchy(new HierarchyValueObject("[Product]", "[Product].[Style]", "Style"));
             
             //now measures can be added
             pivot.addMeasure(new MeasureValueObject("[Measures].[Price]", "Price"));
             pivot.addMeasure(new MeasureValueObject("[Measures].[Discount]", "Discount", AggregationName.AVERAGE));
             
             //then add several data records
             //using addDataRecord
             pivot.addDataRecord({"[Product].[Color]" : "red", "[Product].[Style]" : "classic", "[Measures].[Price]" : 12, "[Measures].[Discount]" : 3});
             pivot.addDataRecord({"[Product].[Color]" : "blue", "[Product].[Style]" : "classic", "[Measures].[Price]" : 13, "[Measures].[Discount]" : 2});
             pivot.addDataRecord({"[Product].[Color]" : "white", "[Product].[Style]" : "sport", "[Measures].[Price]" : 44, "[Measures].[Discount]" : 6});
             pivot.addDataRecord({"[Product].[Color]" : "red", "[Product].[Style]" : "modern", "[Measures].[Price]" : 15, "[Measures].[Discount]" : 3});
             //or using addDataArray
             pivot.addDataArray([
                         ["yellow", "modern", 10, 0],
                         ["yellow", "classic", 13, 3],
                         ["yellow", "sport", 30, 0]
                     ]);
             
             //when the data is passed to the component and you want to see them, call refresh()
             pivot.refresh();
             //the fields list will be opened where you can arrange what data you want to see in rows and in columns
             
             //or you can define a slice (rows, columns, measures) via API using runQuery()
             var slice:Object = 
             {
                 rows: 
                 [
                     {uniqueName: "[Product].[Color]"},
                     {uniqueName: "[Measures]"}
                 ],
                 columns: 
                 [
                     {uniqueName: "[Product].[Style]"}
                 ],
                 measures:
                 [
                     {uniqueName: "[Measures].[Price]"}
                 ]
             };
             pivot.runQuery(slice);
             
To add calculated measure to the report based on CSV data source use addMeasure(). The following example shows the calculated measure Average Price which is calculated as sum("[Measures].[Price]")/count("[Measures].[Price]") and will be added to the list of available measures but not selected for the report (active: false):
             var measure:MeasureValueObject = new MeasureValueObject("[Measures].[Average Price]", "Average Price");
             measure.formula = 'sum("[Measures].[Price]")/count("[Measures].[Price]")';
             measure.calculated = true;
             measure.grandTotalCaption = "Total Average";
             measure.active = false;
             pivot.addMeasure(measure);
             
addStyleToMember()method 
public function addStyleToMember(hierarchyName:String, memberName:String, style:StyleValueObject):void

Applies style to the member of specific hierarchy.

Use refresh() API call after to redraw the component and see changes.

Parameters

hierarchyName:String — hierarchy name.
 
memberName:String — member name.
 
style:StyleValueObject — StyleValueObject that describes style for member.

See also


Example
             var style: StyleValueObject = new StyleValueObject();
             style.backgroundColor = 0xAA3333;
             pivot.addStyleToMember("[Color].[Color]", "[Color].[Color].[red]", style);
             style = new StyleValueObject();
             style.rightIcon = "images/flags/ca.png";
             pivot.addStyleToMember("[Country].[Country]", "[Country].[Country].[Canada]", style);
             style = new StyleValueObject();
             style.color = 0xAAAA33;
             pivot.addStyleToMember("[Category].[Category]", "", style);
             style = new StyleValueObject();
             style.underline = true;
             pivot.addStyleToMember("[Measures]", "[Measures].[Discount]", style);
             pivot.refresh();
             
addUrlToMember()method 
public function addUrlToMember(hierarchyName:String, memberName:String, url:String):void

Adds link to the member of specific hierarchy.

Use refresh() API call after to redraw the component and see changes.

Parameters

hierarchyName:String
 
memberName:String
 
url:String

See also


Example
             pivot.addUrlToMember("[Color].[Color]", "", "http://flexmonster.com?color");
             pivot.addUrlToMember("[Category].[Category]", "[Category].[Category].[Cars]", "http://flexmonster.com?cars");
             pivot.addUrlToMember("[Measures]", "[Measures].[Price]", "http://flexmonster.com?price");
             pivot.refresh();
             
clear()method 
public function clear():void

Clears the component's data and view.


Example
             pivot.clear();
             
clearFilter()method 
public function clearFilter(hierarchyName:String):void

Clears the filter which was applied previously to the specified hierarchy.

Parameters

hierarchyName:String — the name of the hierarchy.

See also


Example
             var filter:Array = [
                 '[Product].[Color].[red]',
                 '[Product].[Color].[green]',
                 '[Product].[Color].[blue]'
             ];
             pivot.setFilter('[Product].[Color]', filter);
             
             pivot.getFilter('[Product].[Color]');
             //method getFilter() returns the following Array
             //[
             //    {'caption' : 'red', 'hierarchyName' : '[Product].[Color]', 'uniqueName' : '[Product].[Color].[red]'},
             //    {'caption' : 'green', 'hierarchyName' : '[Product].[Color]', 'uniqueName' : '[Product].[Color].[green]'},
             //    {'caption' : 'blue', 'hierarchyName' : '[Product].[Color]', 'uniqueName' : '[Product].[Color].[blue]'}
             //]
             
             pivot.getFilterProperties('[Product].[Color]');
             //method getFilterProperties() returns the following object, where type is 'members' and members property has 3 elements
             //{
             //    type : 'members',
             //    members : [
             //        {'caption' : 'red', 'hierarchyName' : '[Product].[Color]', 'uniqueName' : '[Product].[Color].[red]'},
             //        {'caption' : 'green', 'hierarchyName' : '[Product].[Color]', 'uniqueName' : '[Product].[Color].[green]'},
             //        {'caption' : 'blue', 'hierarchyName' : '[Product].[Color]', 'uniqueName' : '[Product].[Color].[blue]'}
             //    ]
             //}
             
             pivot.clearFilter('[Product].[Color]');
             
             pivot.getFilter('[Product].[Color]');
             //after clearFilter() call method getFilter() returns an empty Array
             //[]
             
             pivot.getFilterProperties('[Product].[Color]');
             //after clearFilter() call method getFilterProperties() returns an Object with type 'none' and empty members array
             //{
             //    type : 'none',
             //    members : []
             //}
             
closeFieldsList()method 
public function closeFieldsList():void

Closes Fields List.

See also


Example
             pivot.closeFieldsList();
             
collapseAllData()method 
public function collapseAllData():void

Collapses all nodes and drills up (starting from v2.1) all levels of all hierarchies in slice on the grid and on charts. All expanded/drilled down nodes will be collapsed/drilled up on the grid and on charts.

See also


Example
             pivot.collapseAllData();
             
collapseData()method 
public function collapseData(hierarchyName:String):void

Collapses all nodes of the specified hierarchy.

Parameters

hierarchyName:String — hierarchy unique name

See also


Example
             pivot.collapseData('[Product].[Color]');
             
connectTo()method 
public function connectTo(params:ConnectionParams, callbackHandler:Function = null):void

Connects the component to the specified data source.

There are three possible data sources:

Parameters

params:ConnectionParams — ConnectionParams object which contains connection parameters.
 
callbackHandler:Function (default = null) — function that is invoked when connection process is over. Argument for this function is object. This object contains boolean field success that can be 'true', if connection process was ended successfully, or 'false' if some errors occured in connection process.

See also


Example
Connect to Microsoft Analysis Services:
             var connectionParams = new ConnectionParams();
             connectionParams.dataSourceType = DataSourceType.MSAS; 
             connectionParams.proxyUrl = 'http://olap.flexmonster.com/olap/msmdpump.dll';
             connectionParams.dataSourceInfo = 'Provider=MSOLAP; Data Source=extranet;';
             connectionParams.catalog = 'Adventure Works DW Standard Edition';
             connectionParams.cube = 'Adventure Works';
             pivot.connectTo(connectionParams);
             
Connect to Mondrian:
             var connectionParams = new ConnectionParams();
             connectionParams.dataSourceType = DataSourceType.MONDRIAN; 
             connectionParams.proxyUrl = 'http://olap.flexmonster.com:8080/mondrian/xmla';
             connectionParams.dataSourceInfo = 'MondrianFoodMart';
             connectionParams.catalog = 'FoodMart';
             connectionParams.cube = 'Sales';
             pivot.connectTo(connectionParams);
             
Connect to icCube:
             var connectionParams = new ConnectionParams();
             connectionParams.dataSourceType = DataSourceType.ICCUBE; 
             connectionParams.proxyUrl = 'http://olap.flexmonster.com:8282/icCube/xmla';
             connectionParams.dataSourceInfo = 'icCube-datasource';
             connectionParams.catalog = 'Sales';
             connectionParams.cube = 'Sales';
             pivot.connectTo(connectionParams);
             
Connect to ActivePivot (starting from v2.0):
             var connectionParams = new ConnectionParams();
             connectionParams.dataSourceType = DataSourceType.ACTIVE_PIVOT; 
             connectionParams.proxyUrl = 'http://support.quartetfs.com/logistic_s/xmla';
             connectionParams.dataSourceInfo = 'ActivePivot';
             connectionParams.catalog = 'AllCubes';
             connectionParams.cube = 'OperationCube';
             pivot.connectTo(connectionParams);
             
Connect to SAP BW:
             var connectionParams = new ConnectionParams();
             connectionParams.dataSourceType = DataSourceType.SAP; 
             connectionParams.proxyUrl = 'http://[your.sapbw.domain]:8000/sap/bw/xml/soap/xmla?sap-client=001';
             connectionParams.dataSourceInfo = 'SAP_BW';
             connectionParams.catalog = '$INFOCUBE';
             connectionParams.cube = '$ZFLIGHT_C';
             pivot.connectTo(connectionParams);
             
Connect to CSV data source:
             var connectionParams = new ConnectionParams();
             connectionParams.dataSourceType = DataSourceType.CSV; 
             connectionParams.filename = 'data/csv/arabic.csv';
             pivot.connectTo(connectionParams);
             
Connect to local CSV file:
             var connectionParams = new ConnectionParams();
             connectionParams.dataSourceType = DataSourceType.CSV; 
             connectionParams.browseForFile = true;
             pivot.connectTo(connectionParams);
             
drawCell()method 
public function drawCell(cell:PivotGridCell):void
Deprecated Since version 1.8

Parameters

cell:PivotGridCell

expandAllData()method 
public function expandAllData(withAllChildren:Boolean = true):void

Expands all nodes and drills down all levels of all hierarchies in slice on the grid and on charts. All collapsed/drilled up nodes will be expanded/drilled down on the grid and on charts.

Parameters

withAllChildren:Boolean (default = true) — it is used to expand nodes but not drill down the levels of hierarchies in slice. Please set it to false if you want just expand nodes. Default value is true, which means that the drill down will be performed as well.

See also


Example
Expands all nodes and drills down all hierarchies in slice.
             pivot.expandAllData();
             
Expands all nodes but does not drill down the hierarchies in slice.
             pivot.expandAllData(false);
             
expandData()method 
public function expandData(hierarchyName:String):void

Expands all nodes of the specified hierarchy.

Parameters

hierarchyName:String

See also


Example
             pivot.expandData('[Product].[Color]');
             
export()method 
public function export(type:String, exportOptions:ExportOptions = null, callbackHandler:Function = null):void

Exports grid or chart to CSV, HTML, PDF, Image or Excel format. File can be saved to the local file system, to your server (you need to have a script on the server side) or to the clipboard (only CSV and HTML files).

Parameters

type:String — type of export. There are such types available: ExportType.CSV, ExportType.HTML, ExportType.PDF, ExportType.IMAGE and ExportType.EXCEL.
 
exportOptions:ExportOptions (default = null) — export parameters.
 
callbackHandler:Function (default = null) — callback handler is called only if type is CSV (ExportType.CSV) and destinationType is plain (DestinationType.PLAIN) for exportTo API call. It is called with the following object { data: result }, where result is plain CSV data (CSV string).

See also


Example
Export to CSV and save as local file:
             var exportOptions:ExportOptions = new ExportOptions();
             exportOptions.filename = 'flexmonster.csv';
             pivot.export(ExportType.CSV, exportOptions);
             
Export to HTML file and save to it clipboard:
             var exportOptions:ExportOptions = new ExportOptions();
             exportOptions.filename = 'flexmonster.html';
             exportOptions.destinationType = 'clipboard';
             pivot.export(ExportType.HTML, exportOptions);
             
Export to PDF file, change page orientation to landscape and save file to the server:
             var exportOptions:ExportOptions = new ExportOptions();
             exportOptions.filename = 'flexmonster.pdf';
             exportOptions.pageOrientation = ExportOptions.PAGE_ORIENTATION_LANDSCAPE;
             exportOptions.destinationType = 'server';
             exportOptions.url = 'http://flexmonster.com/save.php';
             pivot.export(ExportType.PDF, exportOptions);
             
Export to Excel and save as local file:
             pivot.export(ExportType.EXCEL);
             
getAllConditions()method 
public function getAllConditions():Array

Returns a list of conditional formatting rules of the report. You may need this API call to edit existing conditional formatting rules.

Returns
Array — Each object in array is a ConditionValueObject.

See also


Example
To get all the conditional formatting rules of the report use getAllConditions(), as follows:
             var conditions:Array = pivot.getAllConditions();
             
getAllHierarchies()method 
public function getAllHierarchies():Array

Returns a list of all available hierarchies.

Returns
Array — Array of HierarchyValueObject objects. If data load is in progress an empty array will be returned.

See also


Example
             pivot.getAllHierarchies();
             
             //method returns array of HierarchyValueObject objects
             //[
             //    {caption: "Business Type", uniqueName: "[Business Type].[Business Type]"},
             //    {caption: "Category", uniqueName: "[Category].[Category]"},
             //    {caption: "Country", uniqueName: "[Country].[Country]"}
             //]
             
getAllMeasures()method 
public function getAllMeasures():Array

Returns a list of all available measures.

Returns
Array — Array of MeasureValueObject objects. Each object describes a measure. If data load is in progress an empty array will be returned.

See also


Example
             pivot.getAllMeasures();
             
             //method returns array of MeasureValueObject objects, where the 2nd measure is calculated
             //[
             //    {aggregation: "sum", 
             //        availableAggregations: ["sum", "count", "distinctcount", "average", "product", "min", "max", "percent", "percentofcolumn"], 
             //        availableAggregationsCaptions: ["Sum", "Count", "Distinct Count", "Average", "Product", "Min", "Max", "Percent", "Percent of Column"], 
             //        calculated: false, 
             //        caption: "Sum of Sales", 
             //        format: "currency", 
             //        formula: "", 
             //        grandTotalCaption: "Total Sum of Sales", 
             //        name: "Sales", 
             //        uniqueName: "[Measures].[Sales]"},
             //    {aggregation: "none", 
             //        availableAggregations: [ ], 
             //        availableAggregationsCaptions: [ ], 
             //        calculated: true, 
             //        caption: "Test", 
             //        format: "", 
             //        formula: "(SUM("[Measures].[Price]") / count("[Measures].[Price]")) * 100", 
             //        grandTotalCaption: "Total Test", 
             //        name: "Test", 
             //        uniqueName: "[Measures].[Test]"}
             //]
             
getCell()method 
public function getCell(rowIdx:int, colIdx:int):PivotGridCell

Returns information about cell by row and column indexes.

Parameters

rowIdx:int — index of the row.
 
colIdx:int — index of the column.

Returns
PivotGridCell — PivotGridCell which contains information about the requested cell.

See also

getColumns()method 
public function getColumns():Array

Returns a list of hierarchies in the "Columns" axis.

Returns
Array — Array of HierarchyValueObject. If data load is in progress an empty array will be returned.

See also


Example
             pivot.getColumns();
             
             //method returns array of HierarchyValueObject
             //[
             //    {caption: "Business Type", uniqueName: "[Business Type].[Business Type]", sort: "desc"},
             //    {caption: "Category", uniqueName: "[Category].[Category]", sort: "asc"}
             //]
             
getColumnWidth()method 
public function getColumnWidth(colIdx:int):int

Returns specified column's width.

Parameters

colIdx:int — index of the column

Returns
int — width of specified column

See also


Example
How to find max column width in the grid:
             var maxWidth:int = 0;
             var columnCount:int = pivot.gridColumnCount;
             for (var i:int = 0; i < columnCount; i++) {
                 var width:int = pivot.getColumnWidth(i);
                 if (maxWidth < width) maxWidth = width;
             }
             trace("Max width is: " + maxWidth);
             
getCondition()method 
public function getCondition(id:String):ConditionValueObject

Returns a conditional formatting rule by id. You may need this API call to edit existing conditional formatting rule.

Parameters

id:String — the id of the conditional formatting rule.

Returns
ConditionValueObject — the ConditionValueObject object that describes the conditional formatting rule.

See also


Example
To get the conditional formatting rule by id use getCondition(), as follows:
             var id:String = "9";
             var condition:ConditionValueObject = pivot.getCondition(id);
             
getFilter()method 
public function getFilter(hierarchyName:String):Array

Returns the filtered members for the specified hierarchy. If data load is in progress or filter is not applied an empty Array will be returned.

Parameters

hierarchyName:String — the name of the hierarchy.

Returns
Array — Array of filtered objects. Each object in array contains the following parameters: caption, uniqueName, and hierarchyName. It is empty if filter is not applied to the hierarchy.

See also


Example
             var filter:Array = [
                 '[Product].[Color].[red]',
                 '[Product].[Color].[green]',
                 '[Product].[Color].[blue]'
             ];
             pivot.setFilter('[Product].[Color]', filter);
             pivot.getFilter('[Product].[Color]');
             
             //method getFilter() returns the following Array
             //[
             //    {'caption' : 'red', 'hierarchyName' : '[Product].[Color]', 'uniqueName' : '[Product].[Color].[red]'},
             //    {'caption' : 'green', 'hierarchyName' : '[Product].[Color]', 'uniqueName' : '[Product].[Color].[green]'},
             //    {'caption' : 'blue', 'hierarchyName' : '[Product].[Color]', 'uniqueName' : '[Product].[Color].[blue]'}
             //]
             
             pivot.clearFilter('[Product].[Color]');
             pivot.getFilter('[Product].[Color]');
             
             //after clearFilter() call method getFilter() returns an empty Array
             //[]
             
getFilterProperties()method 
public function getFilterProperties(hierarchyName:String):Object

Returns the filter properties set for the specified hierarchy. If data load is in progress or filter is not applied an empty Object will be returned.

Parameters

hierarchyName:String — the name of the hierarchy.

Returns
Object — Describes the filter set for the hierarchy. The object always has type and members properties. It may have quantity and measure properties if filter on values is defined. It has all four properties if both filters, on hierarchy's members and on values, are defined:
  • type — Represents the filter type applied to the hierarchy. It can be:
    • 'none' — filter is not applied to the hierarchy,
    • 'members' — the filter on hierarchy's members is applied,
    • 'top' — the filter Top X is applied on values,
    • 'bottom' — the filter Bottom X is applied on values.
  • members — Array of objects represents the filter on hierarchy's members. Each object in array contains the following parameters: caption, uniqueName, and hierarchyName.
  • quantity — Represents the filter on values. Number of elements to choose for the Top X filter if type is 'top' or for the Bottom X filter if type is 'bottom'.
  • measure — Represents the filter on values. The name of the measure on which Top X or Bottom X filter will be applied.

See also


Example
             var filter:Array = [
                 '[Product].[Color].[red]',
                 '[Product].[Color].[green]',
                 '[Product].[Color].[blue]'
             ];
             pivot.setFilter('[Product].[Color]', filter);
             pivot.getFilterProperties('[Product].[Color]');
             
             //method getFilterProperties() returns the following object, where members property has 3 elements
             //{
             //    type : 'members',
             //    members : [
             //        {'caption' : 'red', 'hierarchyName' : '[Product].[Color]', 'uniqueName' : '[Product].[Color].[red]'},
             //        {'caption' : 'green', 'hierarchyName' : '[Product].[Color]', 'uniqueName' : '[Product].[Color].[green]'},
             //        {'caption' : 'blue', 'hierarchyName' : '[Product].[Color]', 'uniqueName' : '[Product].[Color].[blue]'}
             //    ]
             //}
             
             pivot.clearFilter('[Product].[Color]');
             pivot.getFilterProperties('[Product].[Color]');
             
             //after clearFilter() call method getFilterProperties() returns an Object with type 'none' and empty members array
             //{
             //    type : 'none',
             //    members : []
             //}
             
getFormat()method 
public function getFormat(measureName:String):FormatValueObject

Returns the number formatting for the specified measure. Format can be defined via configuration or setFormat() API method. Each measure has only one format but format can be applied to more than one measure.

Parameters

measureName:String — the name of the measure.

Returns
FormatValueObject — FormatValueObject that describes the number formatting.

See also


Example
How to get precision
             var format:Object = pivot.getFormat();
             var precision:int = format.decimalPlaces;
             
How to change currency symbol
             var format:FormatValueObject = pivot.getFormat("[Measures].[Price]");
             format.currencySymbol = "$";
             //format.currencySymbol = "£" // pound sterling
             //format.currencySymbol = "€" // euro
             //format.currencySymbol = "¥" // yen
             pivot.setFormat(format, "[Measures].[Price]");
             
getLabels()method 
public function getLabels():LabelsValueObject

Returns an object which represents current localization. The object contains pairs of key and value of all localized labels.

Returns
LabelsValueObject — LabelsValueObject which contains a list of available labels.

See also


Example
Change labels on "OK" and "Cancel" buttons
             var labels: LabelsValueObject = pivot.getLabels();
             labels.BUTTON_OK = "Accept";
             labels.BUTTON_CANCEL = "Reject";
             pivot.setLabels(labels);
             pivot.refresh()
             
getMeasures()method 
public function getMeasures():Array

Returns a list of the selected measures in the report.

Returns
Array — Array of MeasureValueObject objects. Each object describes a measure. If data load is in progress an empty array will be returned.

See also


Example
             pivot.getMeasures();
             
             //method returns array of MeasureValueObject objects
             //[
             //    {aggregation: "sum", 
             //        availableAggregations: ["sum", "average", "percent"], 
             //        availableAggregationsCaptions: ["Sum", "Average", "Percent"], 
             //        calculated: false, 
             //        caption: "Sum of Sales", 
             //        format: "currency", 
             //        formula: "", 
             //        grandTotalCaption: "Total Sum of Sales", 
             //        name: "Sales", 
             //        uniqueName: "[Measures].[Sales]"},
             //    {aggregation: "sum", 
             //        availableAggregations: ["sum", "count", "distinctcount", "average", "product", "min", "max", "percent", "percentofcolumn", "percentofrow", "index"], 
             //        availableAggregationsCaptions: ["Sum", "Count", "Distinct Count", "Average", "Product", "Min", "Max", "% of Grand Total", "% of Column", "% of Row", "Index"], 
             //        calculated: false, 
             //        caption: "Sum of Orders", 
             //        format: "", 
             //        formula: "", 
             //        grandTotalCaption: "Total Sum of Orders", 
             //        name: "Orders", 
             //        uniqueName: "[Measures].[Orders]"}
             //]
             
getMembers()method 
public function getMembers(hierarchyName:String, memberName:String, callbackHandler:Function = null):Array

Returns a list of members for the specified hierarchy.

CSV data source: if hierarchy has more than one level the method returns a tree where each member has a list of its children. It is enough to set only hierarchyName parameter using getMembers() API call.

OLAP data source: if hierarchy has more than one level the method returns only the members for the first level. To get children of the member, you should call getMembers with hierarchyName, memberName and callbackHandler parameters.

Parameters

hierarchyName:String — the name of the hierarchy.
 
memberName:String — hierarchy's member name. This parameter can be empty string, only the members for the first level of the hierarchy will be returned.
 
callbackHandler:Function (default = null) — Callback handler becomes useful when you works with OLAP data sources and you are not really sure whether you have got all list of members taken in completely or not. OLAP data source is not loaded for the whole data from moment of call but will be load on demand. Callback handler will be called by the component to pass the result asynchronously when the list of members is loaded. If you have already loaded the specified hierarchy members' list into the component, callbackHandler will return instantly the result of the object.

Returns
Array — array of objects with member caption, uniqueName, and hierarchyName for both CSV data source and OLAP data source. Each object will contain children property for CSV data source. Each object will contain isLeaf and parentMember properties for OLAP data source.

If data load is in progress and callbackHandler is not set an empty array will be returned.


Example
CSV data source, where [Category].[Category] hierarchy has only one level:
             pivot.getMembers('[Category].[Category]');
             
             // method returns array of objects
             // [
             //    {caption: "Accessories", hierarchyName: "[Category].[Category]", uniqueName: "[Category].[Category].[Accessories]", children: []},
             //    {caption: "Cars", hierarchyName: "[Category].[Category]", uniqueName: "[Category].[Category].[Cars]", children: []},
             //    {caption: "Clothing", hierarchyName: "[Category].[Category]", uniqueName: "[Category].[Category].[Clothing]", children: []}
             // ]
             
CSV data source, where [Date].[Date] hierarchy has more than one level:
             pivot.getMembers('[Date].[Date]');
             
             //method returns array of objects
             //[
             //    {caption: "2003",
             //     hierarchyName: "[Date].[Date]",
             //     uniqueName: "[Date].[Date].[2003]",
             //     children: [
             //        {caption: "Quarter 1",
             //         hierarchyName: "[Date].[Date]",
             //         uniqueName: "[Date].[Date].[Quarter].[2003/Quarter 1]",
             //         children: [
             //            {caption: "January",
             //             hierarchyName: "[Date].[Date]",
             //             uniqueName: "[Date].[Date].[Month].[2003/Quarter 1/January]",
             //             children: [ ]
             //            }
             //        },
             //        {caption: "Quarter 2",
             //         hierarchyName: "[Date].[Date]",
             //         uniqueName: "[Date].[Date].[Quarter].[2003/Quarter 2]",
             //         children: [
             //            {caption: "April",
             //             hierarchyName: "[Date].[Date]",
             //             uniqueName: "[Date].[Date].[Month].[2003/Quarter 2/April]",
             //             children: [ ]
             //            }
             //        }
             //     ]},
             //    {caption: "2004",
             //     hierarchyName: "[Date].[Date]",
             //     uniqueName: "[Date].[Date].[2004]",
             //     children: [
             //        {caption: "Quarter 3",
             //         hierarchyName: "[Date].[Date]",
             //         uniqueName: "[Date].[Date].[Quarter].[2004/Quarter 3]",
             //         children: [
             //            {caption: "July",
             //             hierarchyName: "[Date].[Date]",
             //             uniqueName: "[Date].[Date].[Month].[2004/Quarter 3/July]",
             //             children: [ ]
             //            },
             //            {caption: "August",
             //             hierarchyName: "[Date].[Date]",
             //             uniqueName: "[Date].[Date].[Month].[2004/Quarter 3/August]",
             //             children: [ ]
             //            }
             //        }
             //     ]}
             //]
             
OLAP data source, where [Product].[Product Categories] hierarchy has more than one level:
             pivot.getMembers('[Product].[Product Categories]', '', onGetMembers);
             
             private function onGetMembers(members:Array):void {
                     for (var i:int = 0; i < members.length; i++) {
                         trace(ObjectUtil.toString(members[i]));
                     }
             }
             
             // the output will be the following:
             //(Object)#0
             //  caption = "Accessories"
             //  hierarchyName = "[Product].[Product Categories]"
             //  isLeaf = false
             //  parentMember = "[Product].[Product Categories].[All]"
             //  uniqueName = "[Product].[Product Categories].[Category].&[4]"
             //(Object)#0
             //  caption = "Bikes"
             //  hierarchyName = "[Product].[Product Categories]"
             //  isLeaf = false
             //  parentMember = "[Product].[Product Categories].[All]"
             //  uniqueName = "[Product].[Product Categories].[Category].&[1]"
             //(Object)#0
             //  caption = "Clothing"
             //  hierarchyName = "[Product].[Product Categories]"
             //  isLeaf = false
             //  parentMember = "[Product].[Product Categories].[All]"
             //  uniqueName = "[Product].[Product Categories].[Category].&[3]"
             //(Object)#0
             //  caption = "Components"
             //  hierarchyName = "[Product].[Product Categories]"
             //  isLeaf = false
             //  parentMember = "[Product].[Product Categories].[All]"
             //  uniqueName = "[Product].[Product Categories].[Category].&[2]"
             
             //and now you can ask for '[Product].[Product Categories].[Category].&[4]' members:
             
             pivot.getMembers('[Product].[Product Categories]', '[Product].[Product Categories].[Category].&[4]', onGetMembers);
             
getOptions()method 
public function getOptions():OptionsValueObject

Returns an OptionsValueObject with component's options.

Returns
OptionsValueObject — OptionsValueObject which contains a list of component's options.

See also


Example
How to turn off totals:
             var options:OptionsValueObject = pivot.getOptions();
             options.showTotals = false;
             pivot.setOptions(options);
             pivot.refresh();
             
getPages()method 
public function getPages():Array

Returns a list of hierarchies in the "Pages" ("Report Filter") axis.

Returns
Array — Array of HierarchyValueObject. If data load is in progress an empty array will be returned.

See also


Example
             pivot.getPages();
             
             //method returns array of HierarchyValueObject
             //[
             //    {caption: "Business Type", uniqueName: "[Business Type].[Business Type]", sort: "desc"},
             //    {caption: "Category", uniqueName: "[Category].[Category]", sort: "asc"}
             //]
             
getReport()method 
public function getReport():ReportValueObject

Returns an object which describes the current report. Use this object to save or edit report at runtime.

Returns
ReportValueObject — ReportValueObject which describes the report and contains all its properties.

See also


Example
Swap two reports
             var report1:ReportValueObject = pivot1.getReport();
             var report2:ReportValueObject = pivot2.getReport();
             
             pivot1.setReport(report2);
             pivot2.setReport(report1);
             
getRowHeight()method 
public function getRowHeight(rowIdx:int):int

Returns row's height with specified index.

Parameters

rowIdx:int — index of the row.

Returns
int — height of the specified row.

See also


Example
How to find max row height in the grid:
             var maxHeight:int = 0;
             var rowCount:int = pivot.gridRowCount;
             for (var i:int = 0; i < rowCount; i++) {
                 var height:int = pivot.getRowHeight(i);
                 if (maxHeight < height) maxHeight = height;
             }
             trace("Max height is: " + maxHeight);
             
getRows()method 
public function getRows():Array

Returns a list of hierarchies in the "Rows" axis.

Returns
Array — Array of HierarchyValueObject. If data load is in progress an empty array will be returned.

See also


Example
             pivot.getPages();
             
             //method returns array of HierarchyValueObject
             //[
             //    {caption: "Business Type", uniqueName: "[Business Type].[Business Type]", sort: "desc"},
             //    {caption: "Category", uniqueName: "[Category].[Category]", sort: "asc"}
             //]
             
getSelectedCell()method 
public function getSelectedCell():PivotGridCell

Returns information about selected cell.

Returns
PivotGridCell — PivotGridCell which contains information about selected cell.

See also

getSort()method 
public function getSort(hierarchyName:String):String

Returns the sort type which is applied to the hierarchy.

Parameters

hierarchyName:String — The name of the hierarchy.

Returns
String — One of the following sort types: SortType.ASC, SortType.DESC or SortType.UNSORTED.

See also


Example
             pivot.getSort("[Country].[Country]");
             
getValue()method 
public function getValue(rowIdx:int, colIdx:int):Number

Returns the cell value by row and column indexes.

Parameters

rowIdx:int — row index.
 
colIdx:int — column index.

Returns
Number — cell value.

See also

getXMLACatalogs()method 
public function getXMLACatalogs(proxyURL:String, dataSource:String, callbackHandler:Function, username:String = null, password:String = null):void

One of four API calls of OLAP/XMLA connectivity diagnostics. Obtains a list of all available catalogs on a given data source by proxyURL and dataSourceInfo. Returns an Array of catalog names.

Parameters

proxyURL:String — the path to proxy URL to the OLAP data source, such as Microsoft Analysis Services, Mondrian, icCube, ActivePivot (starting from v2.0), SAP BW (starting from v1.9).
 
dataSource:String — the service info of the OLAP data source.
 
callbackHandler:Function — function which will be called when the component obtains a list of all available catalogs.
 
username:String (default = null) — the name of user account at server. This is the optional parameter which is necessary to complete authentication process.
 
password:String (default = null) — the password to user account at server. This is the optional parameter which is necessary to complete authentication process.

See also

getXMLACubes()method 
public function getXMLACubes(proxyURL:String, dataSource:String, catalog:String, callbackHandler:Function, username:String = null, password:String = null):void

One of four API calls of OLAP/XMLA connectivity diagnostics. Obtains a list of all available cubes on a given data source by proxyURL, dataSourceInfo and catalog. Returns an Array of cube names.

Parameters

proxyURL:String — the path to proxy URL to the OLAP data source, such as Microsoft Analysis Services, Mondrian, icCube, ActivePivot (starting from v2.0), SAP BW (starting from v1.9).
 
dataSource:String — the service info of the OLAP data source.
 
catalog:String — the data source catalog name of the OLAP data source.
 
callbackHandler:Function — function which will be called when the component obtains a list of all available cubes.
 
username:String (default = null) — the name of user account at server. This is the optional parameter which is necessary to complete authentication process.
 
password:String (default = null) — the password to user account at server. This is the optional parameter which is necessary to complete authentication process.

See also

getXMLADataSources()method 
public function getXMLADataSources(proxyURL:String, callbackHandler:Function, username:String = null, password:String = null):void

One of four API calls of OLAP/XMLA connectivity diagnostics. Obtains a list of all data sources by given URL for XMLA connect (proxyURL). Returns an Array of data sources.

Parameters

proxyURL:String — the path to proxy URL to the OLAP data source, such as Microsoft Analysis Services, Mondrian, icCube, ActivePivot (starting from v2.0), SAP BW (starting from v1.9).
 
callbackHandler:Function — function which will be called when the component obtains a list of all data sources.
 
username:String (default = null) — the name of user account at server. This is the optional parameter which is necessary to complete authentication process.
 
password:String (default = null) — the password to user account at server. This is the optional parameter which is necessary to complete authentication process.

See also


Example
OLAP/XMLA connectivity step by step. First, getXMLADataSources() obtains a list of all data sources by given URL (for example: 'http://olap.flexmonster.com/olap/msmdpump.dll') and getXMLAProviderName() returns dataSourceType. Second, getXMLACatalogs() gets all available catalogs for the first data source from the list of available data sources. Then getXMLACubes() obtains a list of all cubes for the first catalog of the list of available catalogs. Finally, connectTo() uses all the information about data source to connect to it:
             var proxyUrl:String = 'http://olap.flexmonster.com/olap/msmdpump.dll';
             var dataSourceInfo:String = '';
             var dataSourceType:String = '';
             var catalog:String = '';
             var cube:String = '';
             
             function diagnostic():void {
                 getDataSources();
             }
             
             function getDataSources():void {
                 flexmonster.getXMLADataSources(proxyUrl, onDataSourceLoaded);
             }
             
             function onDataSourceLoaded(result:Array):void {
                 dataSourceInfo = result[0];
                 dataSourceType = pivot.getXMLAProviderName(proxyUrl);
                 pivot.getXMLACatalogs(proxyUrl, dataSourceInfo, onCatalogsLoaded);
             }
             
             function onCatalogsLoaded(result) {
                 catalog = result[0];
                 pivot.getXMLACubes(proxyUrl, dataSourceInfo, catalog, onCubesLoaded);
             }
             
             function onCubesLoaded(result) {
                 cube = result[0];
                 pivot.connectTo({
                     dataSourceType: dataSourceType,
                     proxyUrl: proxyUrl,
                     dataSourceInfo: dataSourceInfo,
                     catalog: catalog,
                     cube: cube
                 });
             }
             
getXMLAProviderName()method 
public function getXMLAProviderName(proxyURL:String, callbackHandler:Function, username:String = null, password:String = null):String

One of four API calls of OLAP/XMLA connectivity diagnostics. If getXMLADataSources() is called for proxyURL first and then getXMLAProviderName() is called for the same proxyURL, getXMLAProviderName() will be ready to return dataSourceType immediately. Otherwise callbackHandler is needed to get dataSourceType.

Parameters

proxyURL:String — the path to proxy URL to the OLAP data source, such as Microsoft Analysis Services, Mondrian, icCube, ActivePivot (starting from v2.0), SAP BW (starting from v1.9).
 
callbackHandler:Function — function which will be called when the component is ready to give dataSourceType.
 
username:String (default = null) — the name of user account at server. This is the optional parameter which is necessary to complete authentication process.
 
password:String (default = null) — the password to user account at server. This is the optional parameter which is necessary to complete authentication process.

Returns
String — type of data source for given proxyURL. For OLAP/XMLA connectivity it can be one of the following types: DataSourceType.MSAS, DataSourceType.MONDRIAN, DataSourceType.ICCUBE, DataSourceType.ACTIVE_PIVOT or DataSourceType.SAP.

See also

load()method 
public function load(param:*):void

Loads report from the specified URL.

Parameters

param:* — the URL to report XML file.

See also


Example
             pivot.load("data/reports/report2.xml");
             
open()method 
public function open():void

Opens local report file. Use this API call to open report XML file from local file system.

See also


Example
             pivot.open();
             //The component will provide the dialog box to choose the file which supposed to be loaded from the local file system.
             //Select report XML file to be loaded.
             
openFieldsList()method 
public function openFieldsList():void

Opens Fields List.

See also


Example
             pivot.openFieldsList();
             
percentZoom()method 
public function percentZoom(value:Number):void

Zooms grid in percentage.

Equal to zoom() method, but argument is in percent.

Parameters

value:Number — the percent of zooming. The value can be from 25 to 1000.

See also


Example
             pivot.percentZoom(120);
             
print()method 
public function print():void

Prints the content of the grid or chart via OS print manager.

See also

refresh()method 
public function refresh():void

Redraws the component.

This API call allows you to control redrawing of the component when you use the following API calls:

See also


Example
To add grid title and chart title and redraw the component to see changes, use the following API calls:
             pivot.setGridTitle('grid title');
             pivot.setChartTitle('chart title');
             pivot.refresh(); 
             
removeAllConditions()method 
public function removeAllConditions():void

Removes all conditional formatting rules.

Use refresh() API call after to redraw the component and see changes.

See also


Example
To remove all conditional formatting rules for the report use removeAllConditions(), as follows:
             pivot.removeAllConditions();
             pivot.refresh();
             
removeAllMeasures()method 
public function removeAllMeasures():void

Please note that this feature is available only for reports based on CSV data source. Removes all calculated measures.

See also


Example
To remove all calculated measures use removeMeasure(), as follows:
             pivot.removeAllMeasures();
             
removeCondition()method 
public function removeCondition(id:String):void

Removes the conditional formatting rule by id.

Use refresh() API call after to redraw the component and see changes.

Parameters

id:String — the id of the conditional formatting rule.

See also


Example
To remove the conditional formatting rule by id use removeCondition(), as follows:
             var id:String = "9";
             pivot.removeCondition(id);
             pivot.refresh();
             
removeMeasure()method 
public function removeMeasure(uniqueName:String):void

Please note that this feature is available only for reports based on CSV data source. Removes the calculated measure by measure unique name.

Parameters

uniqueName:String — measure unique name.

See also


Example
To remove the calculated measure use removeMeasure(), as follows:
             var measureName = "[Measures].[Average Price]";
             pivot.removeMeasure(measureName);
             
removeSelection()method 
public function removeSelection():void

Removes selection on the grid

See also

runQuery()method 
public function runQuery(slice:Object):void

Runs a query with specified slice and displays the result data. Use this method to rearrange hierarchies on the axes or to compose a new report based on the current data source.

Parameters

slice:Object — object which contains slice (rows, cols, pages, measures with filters, sorting etc.)

See also


Example
             var slice:Object = 
             {
                 rows: 
                 [
                     {uniqueName: "[Country].[Country]"},
                     {uniqueName: "[Measures]"}
                 ],
                 columns: 
                 [
                     {uniqueName: "[Color].[Color]"}
                 ],
                 measures:
                 [
                     {uniqueName: "[Measures].[Price]"}
                 ]
             };
             pivot.runQuery(slice);
             
save()method 
public function save(filename:String, destinationType:String, callbackHandler:Function = null, url:String, embedData:Boolean = false):void

Saves a report. The report can be saved to local computer, to server or to clipboard as XML file.

Parameters

filename:String — is a name of report XML file.
 
destinationType:String (default = NaN) — String that defines DestinationType. It can be 'file', 'server' or 'clipboard'. Default value is DestinationType.SERVER.
 
callbackHandler:Function (default = null) — optional callback handler. Default value is null.
 
url:String — save report url. Default value is empty String.
 
embedData:Boolean (default = false) — specifies whether to save CSV/OCSV data within the report or not. Default value is false.

See also

setBottomX()method 
public function setBottomX(hierarchyName:String, num:int, measureName:String):void

Sets the Bottom X filter for the specified hierarchy and measure.

Parameters

hierarchyName:String — the name of the hierarchy.
 
num:int — number of elements to choose.
 
measureName:String — the name of the measure on which Bottom X filter will be applied.

See also


Example
             pivot.setBottomX("[Category].[Category]", 3, "[Measures].[Price]");
             
             pivot.getFilterProperties("[Category].[Category]");
             
             //method getFilterProperties() returns the following object:
             //{
             //    type: "bottom",
             //    members: [],
             //    measure: "[Measures].[Price]",
             //    quantity: 3
             //}
             
              pivot.getFilter("[Category].[Category]");
             
             //method getFilter() returns the following array:
             //[
             //    {caption: "Clothing", hierarchyName: "[Category].[Category]", uniqueName: "[Category].[Category].[Clothing]"},
             //    {caption: "Accessories", hierarchyName: "[Category].[Category]", uniqueName: "[Category].[Category].[Accessories]"},
             //    {caption: "Components", hierarchyName: "[Category].[Category]", uniqueName: "[Category].[Category].[Components]"}
             //]
             
setChartTitle()method 
public function setChartTitle(value:String):void

Sets the title for charts in run time.

Use refresh() API call after to redraw the component and see changes.

Parameters

value:String — the charts' title.

See also

setColumnWidth()method 
public function setColumnWidth(colIdx:int, width:int):void

Sets the width of the specified column.

Parameters

colIdx:int — index of the column
 
width:int — new width of the column

See also


Example
Set width of the first column to 200 pixels
             pivot.setColumnWidth(0, 200);
             
setFilter()method 
public function setFilter(hierarchyName:String, items:Array, negation:Boolean = false):void

Sets the filter for the specified hierarchy.

One more property has been added in version 1.7 - negation. If negation is false, setFilter() works the same as it works in previous versions, setFilter() tells the component to show the members of hierarchy specified in items. If negation is true, setFilter() tells the component to show all the members of hierarchy except the items. This allows for providing the shorter list of items when applying filter.

Parameters

hierarchyName:String — the name of the hierarchy.
 
items:Array — Array of hierarchy's members to be reflected/shown according to the applied filter.
 
negation:Boolean (default = false) — It tells the component to show the members of hierarchy specified in items (true) or to show all the members of hierarchy except the items (false).

See also


Example
If you want to see data on 'Canada' and 'France':
             pivot.setFilter("[Country].[Country]", ["[Country].[Country].[Canada]", "[Country].[Country].[France]"]);
             
If you want to see all the colors except 'yellow' now you can do this using the following code, where negation property is true:
             pivot.setFilter("[Product].[Color]", ["[Product].[Color].[yellow]"], true); 
             
instead of
             pivot.setFilter("[Product].[Color]",
                                 ["[Product].[Color].[blue]",
                                  "[Product].[Color].[green]",
                                  "[Product].[Color].[red]",
                                  "[Product].[Color].[silver]",
                                  "[Product].[Color].[white]"
                                 ]
                             ); 
             
setFormat()method 
public function setFormat(format:FormatValueObject, measureName:String):void

Sets a number formatting for the specified measure.

You can format all cells or only concrete measere cells specifying measureName parameter.

Use refresh() API call after to redraw the component and see changes.

Parameters

format:FormatValueObject — FormatValueObject object that is used by this component to format cells.
 
measureName:String — optional parameter. Specify concrete measure to apply format to.

See also


Example
How to change currency symbol
             var format:FormatValueObject = pivot.getFormat("[Measures].[Price]");
             format.currencySymbol = "$";
             //format.currencySymbol = "£" // pound sterling
             //format.currencySymbol = "€" // euro
             //format.currencySymbol = "¥" // yen
             pivot.setFormat(format, "[Measures].[Price]");
             pivot.refresh();
             
setGridTitle()method 
public function setGridTitle(value:String):void

Sets the title for grid in run time.

Use refresh() API call after to redraw the component and see changes.

Parameters

value:String — the grid's title.

See also

setLabels()method 
public function setLabels(labels:LabelsValueObject):void

Applies new values to localized labels.

Use refresh() API call after to redraw the component and see changes.

Parameters

labels:LabelsValueObject — LabelsValueObject which contains localized labels.

See also


Example
Change labels on "OK" and "Cancel" buttons
             var labels: LabelsValueObject = pivot.getLabels();
             labels.BUTTON_OK = "Accept";
             labels.BUTTON_CANCEL = "Reject";
             pivot.setLabels(labels);
             pivot.refresh()
             
setOptions()method 
public function setOptions(options:OptionsValueObject):void

Sets the component's options.

Use refresh() API call after to redraw the component and see changes.

Parameters

options:OptionsValueObject — OptionsValueObject which contains the list of component's options.

See also


Example
How to turn off totals:
             var options:OptionsValueObject = pivot.getOptions();
             options.showTotals = false;
             pivot.setOptions(options);
             pivot.refresh();
             
setReport()method 
public function setReport(obj:ReportValueObject):void

Sets a report to be displayed in the component. Use this method to load and show previously saved reports.

Parameters

obj:ReportValueObject — ReportValueObject

See also


Example
             var report:ReportValueObject = new ReportValueObject();
             var row1:Object = {uniqueName:"[Country].[Country]",caption:"Country"};
             var row2:Object = {uniqueName:"[Product].[Category]",caption:"Category"};
             report.rows = [row1, row2];
             var column:Object = {uniqueName:"[Product].[Color]",caption:"Color"};
             report.columns = [column];
             var page:Object = {uniqueName:"[Product].[Size]",caption:"Size"};
             report.pages = [page];
             var measure:Object = {uniqueName:"[Measures].[Price]",caption:"Price"};
             report.measures = [measure];
             pivot.setReport(report);
             
setRowHeight()method 
public function setRowHeight(rowIdx:int, height:int):void

Sets height of the specified row.

Parameters

rowIdx:int — index of the row
 
height:int — new height of the row

See also


Example
Set height of the first row to 50 pixels
             pivot.setRowHeight(0, 50);
             
setSelectedCell()method 
public function setSelectedCell(rowIdx:int, colIdx:int):void

Sets the selection for the cell by row's and column's indexes.

Parameters

rowIdx:int — Index of the row.
 
colIdx:int — Index of the column.

See also


Example
Select cell on row #3 and column #5.
             pivot.setSelectedCell(3, 5);
             
setSort()method 
public function setSort(hierarchyName:String, sortType:String):void

Sets the sort type to the specified hierarchy.

Parameters

hierarchyName:String — The name of the hierarchy.
 
sortType:String — The following sort types can be applied: SortType.ASC, SortType.DESC or SortType.UNSORTED.

See also


Example
             pivot.setSort("[Country].[Country]", SortType.DESC);
             
setStyleSheet()method 
public function setStyleSheet(value:*):void

Loads a style sheet from the specified URL and applies it to the component. It is also possible to use StyleValueObject as parametr. This method is used to change the style of the component at runtime.

Parameters

value:* — the URL to the style sheet (CSS file) or StyleValueObject.

setTopX()method 
public function setTopX(hierarchyName:String, num:int, measureName:String):void

Sets the Top X filter for the specified hierarchy and measure.

Parameters

hierarchyName:String — the name of the hierarchy.
 
num:int — number of elements to choose.
 
measureName:String — the name of the measure on which Top X filter will be applied.

See also


Example
             pivot.setTopX("[Category].[Category]", 2, "[Measures].[Price]");
             
             pivot.getFilterProperties("[Category].[Category]");
             
             //method getFilterProperties() returns the following object:
             //{
             //    type: "top",
             //    members: [],
             //    measure: "[Measures].[Price]",
             //    quantity: 2
             //}
             
              pivot.getFilter("[Category].[Category]");
             
             //method getFilter() returns the following array:
             //[
             //    {caption: "Cars", hierarchyName: "[Category].[Category]", uniqueName: "[Category].[Category].[Cars]"},
             //    {caption: "Bikes", hierarchyName: "[Category].[Category]", uniqueName: "[Category].[Category].[Bikes]"}
             //]
             
showCharts()method 
public function showCharts(type:String, multiple:Boolean = false):void

Switches to the charts view and shows the chart of the specified type. The following chart types are supported: ChartType.BAR, ChartType.LINE, ChartType.SCATTER, ChartType.PIE, ChartType.BAR_STACK and ChartType.BAR_LINE (starting from v1.9). After showCharts() API call viewType property in report will be ViewType.CHARTS.

This method can be called after the component initialization.

Parameters

type:String — is a chart type
 
multiple:Boolean (default = false) — to show one measure on the chart (false) or multiple (true) - as many measures as selected in the slice

See also

showGrid()method 
public function showGrid():void

Switches to the grid view. After showGrid() API call viewType property in report will be ViewType.GRID.

This method can be called after the component initialization.

See also

showGridAndCharts()method 
public function showGridAndCharts(type:String, multiple:Boolean = false):void

Switches to the grid and charts view and shows the chart of the specified type. The following chart types are supported: ChartType.BAR, ChartType.LINE, ChartType.SCATTER, ChartType.PIE, ChartType.BAR_STACK and ChartType.BAR_LINE (starting from v1.9). After showGridAndCharts() API call viewType property in report will be ViewType.GRID_CHARTS.

This method can be called after the component initialization.

Parameters

type:String — is a chart type
 
multiple:Boolean (default = false) — to show one measure on the chart (false) or multiple (true) - as many measures as selected in the slice

See also

sortValues()method 
public function sortValues(axisName:String, type:String, tuple:Array, measureName:String):void

Sorts values of the specified axis and measure.

Parameters

axisName:String — The name of the axis to be sorted. It can be "rows" or "columns".
 
type:String — The type of sorting: SortType.ASC or SortType.DESC.
 
tuple:Array — The tuple which defines the coordinate of row or column on the grid.
 
measureName:String — Identifies the measure on which sorting will be applied.

See also


Example
             pivot.sortValues("rows", SortType.DESC, ["[Category].[Category].[Cars]"], "[Measures].[Price]");
             
updateData()method 
public function updateData(array:Array):void

Parameters

array:Array

zoom()method 
public function zoom(value:Number):void

Zooms grid to the specified value.

Parameters

value:Number — the value of zooming. The value can be from 0.25 to 10.

See also


Example
             pivot.zoom(0.8);
             
Event Detail
creationComplete Event
Event Object Type: mx.events.FlexEvent

Dispatched when the pivot component creation is complete but data structure is still loading.

fieldsListClose Event  
Event Object Type: com.flexmonster.pivot.events.FieldsListEvent

Dispatched when fields list is closed.

See also

fieldsListOpen Event  
Event Object Type: com.flexmonster.pivot.events.FieldsListEvent

Dispatched when fields list is opened.

See also

filterOpen Event  
Event Object Type: com.flexmonster.pivot.events.FilterEvent

Dispatched when useExternalFilterView property has a true value and a filter icon is pressed.

See also

gridMouseClick Event  
Event Object Type: com.flexmonster.pivot.events.CellClickEvent

Dispatched when a user presses and releases the main button of a pointing device over the defined grid cell.

See also

gridMouseDoubleClick Event  
Event Object Type: com.flexmonster.pivot.events.CellDoubleClickEvent

Dispatched when a user presses and releases the main button of a pointing device twice in rapid succession over the same grid cell.

See also

reportChange Event  
Event Object Type: com.flexmonster.pivot.events.ReportEvent

Dispatched when the report is changed.

reportLoaded Event  
Event Object Type: com.flexmonster.pivot.events.ReportEvent

Dispatched when the report is loaded. From XML file or from API.

updateComplete Event  
Event Object Type: mx.events.FlexEvent

Dispatched when the component loaded data, updated data slice, filter or sort. In other words, when the change occurred in the component.