Menu
Download Free Trial
Table of contents

Quickstart

Embed into the web application

Here you can find a guide through the process of embedding Pivot Table and Charts Component into your HTML using flexmonster.js library.

To get your Pivot Table component embedded you should accomplish the following steps:

  1. Download a free trial of the component and extract the files from the downloaded package.
  2. Copy flexmonster/ folder into your web project root to your server.
  3. Include jquery and flexmonster.js into your HTML page. Please note, that your page should be in the same folder as flexmonster/:
    <script src="flexmonster/lib/jquery.min.js"></script>
    <script src="flexmonster/flexmonster.js"></script>
    
    
  4. Create <div> container for the component:
    <div id="pivotContainer">The component will appear here</div>
    <script src="flexmonster/lib/jquery.min.js"></script>
    <script src="flexmonster/flexmonster.js"></script>
    
  5. Add simple script to embed the component:
    <div id="pivotContainer">The component will appear here</div>
    <script src="flexmonster/lib/jquery.min.js"></script>
    <script src="flexmonster/flexmonster.js"></script>
    
    <script>
    	var pivot = $("#pivotContainer").flexmonster({
    		toolbar: true,
    		licenseKey: "XXXX-XXXX-XXXX-XXXX-XXXX"
    	});
    </script>
    
    
  6. Now launch the page from browser — here you go! The component without data is embedded into your project. You can see the example on JSFiddle.
  7. The next step is to see your own data on the grid. Find detailed tutorials for connecting Pivot Table to the following data sources: JSON, CSV, SQL database, Microsoft Analysis Services, Mondrian and icCube.

Should you have any problems — visit our troubleshooting page.

Initial jQuery call to embed the component

This is the first API call you need to know.

$("#pivotContainer").flexmonster({
	componentFolder:String, 
	global:Object, 
	width:Number, 
	height:Number, 
	report:Object|String, 
	toolbar:Boolean, 
	licenseKey:the license key})

As a parameter jQuery call gets id of the HTML element you would like to have as a container for the component.
It embeds the component into HTML page and allows you to provide it with all necessary information for the initialization by setting the following arguments:

  • componentFolder – URL of the component’s folder which contains all necessary files. Also, it is used as a base URL for report files, localization files, styles and images. The default value for componentFolder is flexmonster/.
  • global – object that allows you to preset options for all reports. These options can be overwritten for concrete reports. Object structure is the same as for report.
  • width – width of the component on the page (pixels or percent). The default value for width is 100%.
  • height – height of the component on the page (pixels or percent). The default value for height is 500.
  • report – property to set a report. It can be inline report JSON or URL to report JSON. XML reports are also supported in terms of backward compatibility.
  • toolbar – parameter to embed the toolbar (the one that is shown in Pivot Table demo) or not. Default value is false – without toolbar.
  • licenseKey – the license key.

All the parameters are optional. If you run $("#pivotContainer").flexmonster() – empty component without toolbar will be added with the default width and height.