Autofit a row on an Excel worksheet

This REST API autofits a row on an Excel worksheet.

REST API

POST https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/autofitrow

Request parameters

Parameter Name Type Location Description
name string path The name of the Excel file.
sheetName string path The name of the worksheet.
rowIndex integer query Zero‑based index of the row to autofit.
firstColumn integer query Index of the first column included in the operation.
lastColumn integer query Index of the last column included in the operation.
autoFitterOptions object body Object that controls the autofit behavior (e.g., whether to consider merged cells, wrap text, etc.). See AutoFitterOptions{:rel=“noopener” title=“Controls autofit behavior”}.
folder string query Folder where the file is stored.
storageName string query Name of the storage.

Entity Definitions

Entity Description
rowIndex Zero‑based index of the target row.
firstColumn Starting column for the autofit operation.
lastColumn Ending column for the autofit operation.
autoFitterOptions Optional settings that influence how the row is autofit (merged cells, wrap text, etc.).

The OpenAPI Specification defines a publicly accessible programming interface and lets you perform REST interactions directly from a web browser.

You can use the cURL command‑line tool to access Aspose.Cells web services easily. The example below demonstrates how to call the API with cURL.

Error Handling

The API returns standard HTTP status codes. Common error responses for this endpoint are:

HTTP Code Example Payload Meaning
400 { "Code": 400, "Message": "Row index out of range." } The supplied rowIndex does not exist in the worksheet.
401 { "Code": 401, "Message": "Invalid or expired token." } Authentication failed – check the JWT token and ensure the request is over HTTPS.
404 { "Code": 404, "Message": "File not found." } The specified Excel file or worksheet cannot be located.
500 { "Code": 500, "Message": "Internal server error." } An unexpected server‑side problem occurred.

Cloud SDK Family

Using an SDK is the fastest way to develop. An SDK abstracts low‑level details, allowing you to focus on your business logic. See the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.

The following code examples demonstrate how to call Aspose.Cells web services using various SDKs: