GrapeCity Documents for Excel, Java Edition, (GcExcel Java) is a high-speed, feature-rich Excel document API based on VSTO. We released the GcExcel for .NET Version in April 2018, and with this launch, it's now possible to use a similar package in Java applications.
Here is data that displays revenue from selling produce in different countries. This data is not arranged country-wise, and the types of produce varies in order.
We’ll want to gather the total amount earned from the types of produce and filter it country-wise. We’ll use a Pivot table for this with GcExcel.
To create a pivot table in GcExcel, initialize the workbook.
Add data and assign it to a range in the worksheet.
Add a Pivot Table and assign the range of data.
Set the location of Pivot Table.
Let’s set up the Pivot Table fields. Assign the respective Pivot Table fields to the worksheet columns.
We’ll need to calculate total amount of money earned row-wise, so your Row Field will be a Category.
We’ll need the figures for each Product in the Category. Set the 'Column Field' to the Product.
We’ll want the total on the amount, so set the 'Data Field' to 'Amount.'
If you want to see the totals, country-wise, set the Page Field of the Pivot Table to 'Country'.
Save the workbook and see the result. We can see the Pivot table displays the exact results required.
With GcExcel, you can command total control of your spreadsheets—with no dependencies on Excel.
If you have a comment or question about this tutorial, please leave your comments in the thread below.