This short tutorial guides you to create Excel pivot table using Node.js. It has the details to set the IDE for development, a list of steps, and a sample code for adding Excel pivot reporting using Node.js. You will learn to access the pivot tables collection and add pivot tables in a sheet, set different data and display parameters for the pivot table.
Steps to Create Pivot Table using Node.js
- Set the IDE to use Aspose.Cells for Node.js via Java to create a pivot table
- Load the Excel file with data into a Workbook object for creating pivot reporting
- Access the pivot tables collection from the target sheet and add a new pivot table
- Hide the grand total for the rows in the pivot table
- Add column, row and data fields to the pivot table
- Save the resultant Excel file with the pivot table
These steps provide a summary of how to make a pivot table in Excel using Node.js. Initiate the process by adding a new pivot table in the existing collection of pivot tables by providing the destination cells area and setting the display characteristics. Finally, add the fields of types column, row, and data to the area and save the output Excel file.
Code to Excel Pivot Table using Node.js
This code demonstrates how to add pivot table in Excel using Node.js. In this code, we have added different fields to the area, however you may add PAGE-type fields also. The pivot tables collection class supports various features for working with pivot tables for instance creating, deleting and updating existing pivot tables.
This article has taught us how to work with pivot table using Node.js. To delete a pivot table, refer to the article on how to delete pivot table using Node.js.