[]
        
(Showing Draft Content)

Pivot Table

In SpreadJS, a pivot table is a powerful tool that allows you to summarize and analyze large amounts of data in a structured and organized manner. It enables you to reorganize and present your data in a more meaningful way without altering the original data set.

In the SpreadJS Designer Component, the PivotTable button is available inside the ribbon’s INSERT > Tables tab group.

SpreadJS Designer displays the PivotTable command in the Tables group of the INSERT ribbon tab for starting a PivotTable creation workflow.

You can create a PivotTable in the SpreadJS Designer Component in the following ways:

  • Create a PivotTable from a selected data range.

  • Create a PivotTable from a Data Manager table or view.

Before using PivotTables in the Designer Component, make sure the PivotTable add-on is available in your application.

  1. Purchase a valid PivotTable add-on license.

Note: PivotTable is a separate deployment add-on package in SpreadJS. To deploy this feature, you should have a valid SpreadJS license along with the PivotTable add-on license. For more information, please refer to SpreadJS Designer Component and PivotTable Add-on and SpreadJS Pricing and Licensing pages.

  1. Use the SpreadJS Designer Component in your project with a new or existing spreadsheet by following the steps mentioned on the Quick Start page.

  2. Add the following additional script file in your SpreadJS Designer Component application to use the PivotTable feature.

   <script src="scripts/gc.spread.pivot.pivottables.x.x.x.min.js" type="text/javascript"></script>
  1. Run the application. You can now create PivotTables in the SpreadJS Designer Component.

Create a PivotTable from a Data Range

You can create a PivotTable by selecting a worksheet range as the data source.

  1. Import or create the data source that you want to analyze.

Note:

Also supports full column as data source, for example '=Sheet!$A:$B', but does not support relative references.

  1. Go to the INSERT tab and click on the PivotTable button.


    SpreadJS Designer highlights the PivotTable button on the INSERT tab, which developers select after preparing a worksheet data range for analysis.


  2. Select the data that you want to analyze using a pivot table and select either New Worksheet or Existing Worksheet. In the case of Existing Worksheet, select the range where you want the pivot table to appear and click OK.

  3. Click on the PivotTable area to work with the pivot table. This will open the pivot panel.


    SpreadJS Designer opens the pivot panel beside the worksheet when the PivotTable area is selected, providing fields and layout areas for report configuration.

  4. Use the pivot panel to add, remove, drag, and move fields in a pivot table as per your requirement. For more information, see Pivot Table.

The following GIF illustrates the steps to create a pivot table.

SpreadJS Designer selects a worksheet data range, opens the Create PivotTable dialog, inserts the report, and uses the pivot panel to arrange fields.

Create a PivotTable from a Data Manager Table

You can also create a PivotTable directly from a Data Manager table or view.

  1. Make sure that a Data Manager table or view is available in the Designer Component.

  2. Go to the INSERT tab and open the PivotTable drop-down menu.

  3. Select From Data Table.

    SpreadJS Designer opens the PivotTable drop-down menu and presents the From Data Table command for creating a report from a Data Manager source.

    If no Data Manager table is available, From Data Table is disabled.

  4. In the Create PivotTable dialog, choose the data that you want to analyze.

    You can select a source from the following fields:

    • Data Table: Select a Data Manager table.

    • Data View: Select a Data Manager view.

      SpreadJS Designer Create PivotTable dialog lets developers choose a Data Manager table or view, enable Auto refresh, and select the report placement.

  5. Optional: Select Auto refresh to refresh the PivotTable automatically when the source data changes.

  6. Choose where you want the PivotTable report to be placed.

    You can select either:

    • New Worksheet

    • Existing Worksheet

    If you select Existing Worksheet, select the range where you want the PivotTable to appear.

  7. Click OK.

Designer creates a new worksheet and inserts a PivotTable based on the selected Data Manager table or view.

Quickly Create a PivotTable from a Data Manager Table

When Data Manager tables are available, the From Data Table menu can also display the available tables.

SpreadJS Designer expands the From Data Table submenu to list available Data Manager tables for quickly creating a PivotTable on a new worksheet.

To quickly create a PivotTable from a Data Manager table:

  1. Go to the INSERT tab and open the PivotTable drop-down menu.

  2. Point to From Data Table to display the available Data Manager tables.

  3. Select a table from the list.

Designer creates a new worksheet and inserts a PivotTable based on the selected Data Manager table.

This quick creation flow is available for Data Manager tables. To create a PivotTable from a Data Manager view or to configure the placement options, use the Create PivotTable dialog.