Flexmonster Pivot Table configuration is possible to be set via FlashVars. (Alternative way - via XML)
Pivot uses SWFObject library for inserting in HTML, so all FlashVars examples use it's syntax.
Flashvars configuration is responsible for the following Pivot table aspects:
Flexmonster Pivot Table supports different data sources, such as: CSV files, OLAP, XML from custom web services.
One of this blocks is required to run Flexmonster Pivot Table.
To configure CSV data source for Pivot Table you should:
so.addVariable("dataSourceType", "CSV");
so.addVariable("dataSourceType", "CSV");
so.addVariable("filename", "data/data.csv");
so.addVariable("dataSourceType", "CSV");
so.addVariable("filename", "data/data.csv");
so.addVariable("fieldSeparator", ",");
To configure OLAP data source for Pivot Table you should:
so.addVariable("dataSourceType", "OLAP");
so.addVariable("dataSourceType", "OLAP");
so.addVariable("dataSource", "Provider=MSOLAP; Data Source=extranet;");
so.addVariable("dataSourceType", "OLAP");
so.addVariable("dataSource", "Provider=MSOLAP; Data Source=extranet;");
so.addVariable("catalog", "Adventure Works DW Standard Edition");
so.addVariable("dataSourceType", "OLAP");
so.addVariable("dataSource", "Provider=MSOLAP; Data Source=extranet;");
so.addVariable("catalog", "Adventure Works DW Standard Edition");
so.addVariable("cube", "Adventure Works");
so.addVariable("dataSourceType", "OLAP");
so.addVariable("dataSource", "Provider=MSOLAP; Data Source=extranet;");
so.addVariable("catalog", "Adventure Works DW Standard Edition");
so.addVariable("cube", "Adventure Works");
so.addVariable("proxyUrl", "http://10.14.2.102/olap/msmdpump.dll");
You can create a predefined report via FlashVars; define columns, rows, values to get exact data you need immediately after the Pivot Table is opened. Reports configuration is the same for both CSV and OLAP data sources. To configure predefined report for Pivot Table you should:
so.addVariable("rows", "[Business Type].[Business Type], [Color].[Color]");
so.addVariable("rows", "[Business Type].[Business Type], [Color].[Color]");
so.addVariable("columns", "[Country].[Country]");
so.addVariable("rows", "[Business Type].[Business Type], [Color].[Color]");
so.addVariable("columns", "[Country].[Country]");
so.addVariable("measures", "[Measures].[Price], [Measures].[Discount]");
so.addVariable("rows", "[Business Type].[Business Type], [Color].[Color]");
so.addVariable("columns", "[Country].[Country]");
so.addVariable("measures", "[Measures].[Price], [Measures].[Discount]");
so.addVariable("pages", "[Destination].[Destination]");
Predefined report requires rows, columns, and measures. Pages are optional.
UI configuration block of XML configuration consists of the following 3 parts:
Skins and visual appearance can be controlled with easy-to-edit CSS and images. To define the path to CSS file, styleSheetName FlashVar is used:
so.addVariable("styleSheetName", "original.css");
To get more information on Pivot Table CSS please read CSS for Pivot Table Skins and Visual Appearance.
You can easily configure UI, define which UI elements are needed and which ones should be turned off.
You can enable or disable via FlashVars the following set of visual elements:
configuratorEnabled – if true, configurator is enable to edit;, default: trueExample:
configuratorActive – if true, configurator is open after start; default: true
so.addVariable("configuratorEnabled", true);
so.addVariable("configuratorActive", true);
chartsEnabled – if true, charts are enable to view; default: trueExample:
chartsActive – if true, charts are active after start; default: false
so.addVariable("chartsEnabled", true);
so.addVariable("chartsActive", false);
so.addVariable("printEnabled", false);
so.addVariable("fullScreenEnabled", false);
Note: To use Full-screen mode, flash player should be allowed to use it. More detales in Flash player documentation.
so.addVariable("zoomEnabled", false);
so.addVariable("stylesEnabled", false);
so.addVariable("expandAll", false);
so.addVariable("excelLikeHeader", false);
so.addVariable("autoCollapse", false);
For example, Pivot Table component will have "Fields List" configurator opened, ability to switch to Pivot Charts, ability to print Pivot Table and Pivot Charts, enabled full screen tool, disabled zoom tool, no styles combobox, Expand/Collapse All button, no Excel like headers, and headers auto collapsed if FlashVars configuration will have the following parameters:
so.addVariable("configuratorEnabled", true);
so.addVariable("configuratorActive", true);
so.addVariable("chartsEnabled", true);
so.addVariable("chartsActive", false);
so.addVariable("printEnabled", false);
so.addVariable("fullScreenEnabled", true);
so.addVariable("zoomEnabled", false);
so.addVariable("stylesEnabled", false);
so.addVariable("expandAll", false);
so.addVariable("excelLikeHeader", false);
so.addVariable("autoCollapse", true);
The following parameters of values formatting can be set:
Example with default values:
so.addVariable("thousandsSeparator", " ");
so.addVariable("decimalSeparator", ".");
so.addVariable("decimalPlaces", "-1");
so.addVariable("maxSymbols", "12");
so.addVariable("currencySymbol", "");
so.addVariable("currencySymbolAlign", "left");