Convert Table to Pivot Table – Aspose.Cells Cloud Documentation
This REST API creates a pivot table from a list object.
Prerequisites:
- A valid JWT bearer token for authentication.
- The workbook must exist in the specified storage location.
- The target worksheet must contain the list object you want to summarize.
REST API
POST http://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/listobjects/{listObjectIndex}/SummarizeWithPivotTable
Request parameters
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| name | string | path | Workbook file name. |
| sheetName | string | path | Worksheet that contains the list object. |
| listObjectIndex | integer | path | Index of the list object in the worksheet. |
| destsheetName | string | query | Name of the destination worksheet. |
| request | object | body | JSON payload that defines the pivot table. |
| folder | string | query | Folder path where the workbook resides. |
| storageName | string | query | Name of the storage. |
The request body must follow the JSON schema defined below:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"Name": { "type": "string", "description": "Name of the new pivot table." },
"DestCellName": { "type": "string", "description": "Top‑left cell of the pivot table (e.g., \"C1\")." },
"PivotFieldRows": {
"type": "array",
"items": { "type": "integer" },
"description": "Zero‑based indices of fields to place in rows."
},
"PivotFieldColumns": {
"type": "array",
"items": { "type": "integer" },
"description": "Zero‑based indices of fields to place in columns."
},
"PivotFieldData": {
"type": "array",
"items": { "type": "integer" },
"description": "Zero‑based indices of fields to use as data fields."
}
},
"required": ["Name", "DestCellName", "PivotFieldRows", "PivotFieldColumns", "PivotFieldData"]
}
The OpenAPI Specification defines a publicly accessible programming interface and lets you carry out REST interactions directly from a web browser.
You can use the cURL command‑line tool to access Aspose.Cells web services easily. The following example shows how to make calls to the Cloud API with cURL.
Response Status Codes
| Code | Description |
|---|---|
| 200 | Pivot table created successfully. |
| 400 | Bad request – invalid parameters or payload. |
| 401 | Unauthorized – missing or invalid JWT token. |
| 403 | Forbidden – insufficient permissions. |
| 404 | Not found – workbook, worksheet, or list object does not exist. |
| 500 | Internal server error – unexpected failure on the server side. |
Cloud SDK Family
Using an SDK is the best way to speed up development. An SDK handles low‑level details and lets you focus on your project tasks. Please check out the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.
The following code examples demonstrate how to make calls to Aspose.Cells web services using various SDKs: