This quick tutorial explains how to group rows in Excel with Node.js. It has the details to set the IDE for the application development, a list of steps depicting the process, and a runnable sample code showing how to group columns in Excel with Node.js. You will also learn to ungroup rows and columns and set a flag for the default state of collapsed rows or columns when you open it in MS Excel.
Steps to Group Columns in Excel with Node.js
- Set the IDE to use Aspose.Cells for Node.js via Java to group rows and columns
- Load the Excel file using the Workbook and access the target sheet from the collection of sheets
- Access the cell collection object and call the groupRows() method
- Call the groupColumns() method to group columns if required
- Save the output file
These steps describe how to group rows in Excel with expand collapse with Node.js. Commence the process by loading the source Excel file into the Workbook class object and accessing the cells collection to use the required methods. Call the groupRows() method for grouping rows and the groupColumns() method for grouping the columns.
Code For Grouping Rows in Excel with Node.js
This code demonstrates how to create collapsible rows in Excel with Node.js. You can set the default state of the grouped rows by passing the desired state as the third argument to the methods groupRows() and groupColumns(), where ‘true’ will collapse the date and ‘false’ will expand the data. You can ungroup the rows and columns using the ungroupRows() and ungroupColumns() methods.
In this topic, we have learned to create collapsible rows and columns in an Excel file. To apply the Excel theme, refer to the article on Apply Excel Theme with Node.js.