Export Excel Worksheet to Various Formats – Aspose.Cells Cloud
You can export a worksheet to the following formats:
- XLS – XLS format details
- XLSX – XLSX format details
- XLSB – XLSB format details
- CSV – CSV format details
- TSV – TSV format details
- XLSM – XLSM format details
- ODS – ODS format details
- TXT – TXT format details
- PDF – PDF format details
- OTS – OTS format details
- XPS – XPS format details
- DIF – DIF format details
- PNG – PNG format details
- JPEG – JPEG format details
- BMP – BMP format details
- SVG – SVG format details
- TIFF – TIFF format details
- EMF – EMF format details
- NUMBERS – Numbers format details
- FODS – FODS format details
Explore related export operations such as exporting an entire workbook or a chart.
PostExport API
POST https://api.aspose.cloud/v3.0/cells/export
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication.
Request Parameters
| Parameter Name | Type | Path/Query String/HTTP Body | required | Description |
|---|---|---|---|---|
| file | file | formData | True | File to upload |
| objectType | string | query | True | The type of object to export. For chart export use chart. Other possible values are worksheet, picture, etc. |
| format | string | query | True | Desired output format. Supported values: png, jpeg, gif, bmp, svg, tiff, emf, wmf, pdf. |
Response
{
"Files": [
{
"Filename": "Book1_xlsx_Sheet1.tif",
"FileSize": 390,
"FileContent": "-----Base64String--------"
},
{
"Filename": "Book1_xlsx_Sheet2.tif",
"FileSize": 10040,
"FileContent": "-----Base64String--------"
},
{
"Filename": "Book1_xlsx_Sheet3.tif",
"FileSize": 2824,
"FileContent": "-----Base64String--------"
},
{
"Filename": "Book1_xlsx_Sheet4.tif",
"FileSize": 1350,
"FileContent": "-----Base64String--------"
},
{
"Filename": "Book1_xlsx_Sheet5.tif",
"FileSize": 12978,
"FileContent": "-----Base64String--------"
},
{
"Filename": "Book1_xlsx_Sheet6.tif",
"FileSize": 7002,
"FileContent": "-----Base64String--------"
},
{
"Filename": "Book1_xlsx_Sheet7.tif",
"FileSize": 11532,
"FileContent": "-----Base64String--------"
},
{
"Filename": "myDocument_xlsx_Sheet1.tif",
"FileSize": 382,
"FileContent": "-----Base64String--------"
},
{
"Filename": "myDocument_xlsx_Sheet2.tif",
"FileSize": 382,
"FileContent": "-----Base64String--------"
},
{
"Filename": "myDocument_xlsx_Sheet3.tif",
"FileSize": 130084,
"FileContent": "-----Base64String--------"
},
{
"Filename": "myDocument_xlsx_Sheet4.tif",
"FileSize": 120062,
"FileContent": "-----Base64String--------"
}
]
}
Error handling
If the request fails, the API returns a JSON error object containing fields such as Code and Message. Typical HTTP status codes include 401 Unauthorized (missing or invalid token) and 400 Bad Request (invalid parameters).
HTTP Status Codes
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Filter applied successfully; response contains operation details. |
| 400 | Bad Request | Missing or invalid parameters (e.g., unsupported file type). |
| 401 | Unauthorized | Invalid or missing JWT token. |
| 413 | Payload Too Large | Uploaded file exceeds size limit. |
| 500 | Internal Server Error | Unexpected server error. |
Notes
- Maximum file size for upload is 50 MB.
- The API supports exporting multiple worksheets in a single request; each worksheet is returned as a separate file in the
Filesarray. - Asynchronous processing is available for large workbooks; use the
202 Acceptedresponse to poll the operation status.
How to Use the PostExport API with SDKs
Prerequisites
Before calling the API, obtain a valid JWT access token using the Aspose.Cells Cloud authentication flow. Ensure the token is included in the Authorization header of each request. The SDKs handle token acquisition automatically when configured with your client credentials.
PostExport API Specification
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 following example shows how to call the Cloud API with cURL.
# Export a worksheet to TIFF format
curl -X POST "https://api.aspose.cloud/v3.0/cells/export?objectType=worksheet&format=tiff" \
-H "Authorization: Bearer <access_token>" \
-H "accept: multipart/form-data" \
-H "Content-Type: multipart/form-data" \
-H "x-aspose-client: Containerize.Swagger" \
-F "File=@MyWorkbook.xlsx"
Use Aspose.Cells Cloud SDKs
Using an SDK is the fastest way to develop against Aspose.Cells Cloud. An SDK abstracts low‑level details, allowing you to focus on your business logic. For a complete list of supported SDKs, please visit the GitHub repository.
The following code examples demonstrate how to call Aspose.Cells web services using various SDKs: