Group Columns – Aspise.Cells Cloud API Documentation
Group Columns on an Excel Worksheet
API version: v3.0
Operation: PostGroupWorksheetColumns – Group worksheet columns in the worksheet.
Overview
This REST API lets you group a range of columns in a worksheet. Grouped columns can be shown or hidden, enabling you to create collapsible sections similar to those in Microsoft Excel.
Prerequisites
- A valid JWT access token obtained from the Aspose Cloud authentication service.
- The workbook must be stored in a location accessible to Aspose.Cells Cloud (default storage or a custom storage name).
- Required SDK version (if using an SDK): the latest release that supports API version v3.0.
Authentication
All requests require Bearer token authentication.
Authorization: Bearer <access_token>
For details on obtaining a token, see the JWT authentication guide.
HTTP Request
POST https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/cells/columns/group
| Parameter | Location | Required | Description |
|---|---|---|---|
name |
Path | Yes | The workbook file name (e.g., test.xlsx). |
sheetName |
Path | Yes | The worksheet that contains the columns to group. |
firstIndex |
Query | Yes | Zero‑based index of the first column to include in the group. |
lastIndex |
Query | Yes | Zero‑based index of the last column to include in the group. |
hide |
Query | No | If true, the grouped columns are hidden; otherwise they remain visible. |
folder |
Query | No | Path to the folder that contains the workbook. |
storageName |
Query | No | Name of the storage service where the file is located. |
Request Example (cURL)
curl -X POST "https://api.aspose.cloud/v3.0/cells/test.xlsx/worksheets/Sheet1/cells/columns/group?firstIndex=1&lastIndex=2&hide=true" \
-H "accept: application/json" \
-H "Authorization: Bearer <access_token>"
Note: The request uses HTTPS to ensure encrypted communication.
Response
Success (200)
| Field | Type | Description |
|---|---|---|
Code |
integer | HTTP status code (200). |
Status |
string | Textual status of the operation (OK). |
Example
{
"Code": 200,
"Status": "OK"
}
Error (e.g., 400 Bad Request)
| Field | Type | Description |
|---|---|---|
Code |
integer | HTTP status code (400, 401, 404, 500, …). |
Status |
string | Textual status (Error). |
ErrorMessage |
string | Human‑readable description of the problem. |
ErrorCode |
string | Programmatic identifier for the error. |
Example – Bad Request
{
"Code": 400,
"Status": "Error",
"ErrorMessage": "Invalid column index.",
"ErrorCode": "InvalidParameter"
}
SDK Examples
The following snippets demonstrate how to call the Group Worksheet Columns operation using the supported SDKs.
Remarks
- Grouping behavior: The API creates a column group that can be expanded or collapsed in Excel. Setting
hide=truecollapses the group immediately. - Zero‑based indexing: Both
firstIndexandlastIndexstart at 0; the first column in a worksheet is index 0. - Storage considerations: If the workbook resides in a non‑default storage, provide both
folderandstorageNamequery parameters.
See Also
- Authentication – JWT token based
- OpenAPI Specification for Group Worksheet Columns
- Aspose.Cells Cloud SDKs (GitHub)
- Group Rows on an Excel Worksheet
Illustration:
{: .img-fluid alt=“Screenshot showing grouped columns in an Excel worksheet” }
The above placeholder image should be replaced with an actual screenshot that demonstrates the visual result of grouping columns.
{: .img-fluid alt=“Screenshot showing grouped columns in an Excel worksheet” }