处理 Excel 行 — Aspose.Cells Cloud API
Contents
[
Hide
]
在 Excel 文件中处理行
最后更新时间:2026 年 7 月
- 如何获取 Excel 工作表中的行信息
- 如何在 Excel 工作表中添加空行
- 如何在 Excel 工作表中复制行
- 如何在 Excel 工作表中隐藏行
- 如何在 Excel 工作表中取消隐藏行
- 如何在 Excel 工作表中对行进行分组
- 如何在 Excel 工作表中取消行分组
- 如何从工作表中删除行
常见行操作的快速 API 参考:
| 操作 | HTTP 方法 | 端点 | 关键参数 |
|---|---|---|---|
| 获取行 | GET | /cells/{fileName}/worksheets/{sheetName}/rows/{rowIndex} |
fileName, sheetName, rowIndex |
| 添加行 | POST | /cells/{fileName}/worksheets/{sheetName}/rows |
rowIndex, height |
| 复制行 | POST | /cells/{fileName}/worksheets/{sheetName}/rows/copy |
sourceIndex, destinationIndex, rowCount |
| 删除行 | DELETE | /cells/{fileName}/worksheets/{sheetName}/rows/{rowIndex} |
fileName, sheetName, rowIndex |
| 隐藏行 | POST | /cells/{fileName}/worksheets/{sheetName}/rows/hide |
startIndex, endIndex |
| 取消隐藏行 | POST | /cells/{fileName}/worksheets/{sheetName}/rows/unhide |
startIndex, endIndex |
| 分组行 | POST | /cells/{fileName}/worksheets/{sheetName}/rows/group |
startIndex, endIndex |
| 取消分组行 | POST | /cells/{fileName}/worksheets/{sheetName}/rows/ungroup |
startIndex, endIndex |
请求 / 响应详情
-
获取行
请求:无需请求体。
响应(200):{ "RowIndex": 5, "Height": 15.0, "IsHidden": false, "Style": { ... } }错误:400 Bad Request(索引无效),404 Not Found(文件或工作表不存在)。
-
添加行
请求体(JSON):{ "RowIndex": 10, "Height": 20.0 }响应(201):
{ "Code": "Success", "Status": "Row added", "RowIndex": 10 }错误:400 Bad Request(缺少或无效参数),401 Unauthorized。
-
复制行
请求体(JSON):{ "SourceIndex": 2, "DestinationIndex": 8, "RowCount": 3 }响应(200):
{ "Code": "Success", "Status": "Rows copied" }错误:400 Bad Request,404 Not Found。
-
删除行
请求:无需请求体。
响应(200):{ "Code": "Success", "Status": "Row deleted", "RowIndex": 7 }错误:400 Bad Request,404 Not Found。
-
隐藏行
请求体(JSON):{ "StartIndex": 3, "EndIndex": 5 }响应(200):
{ "Code": "Success", "Status": "Rows hidden" }
错误:400 Bad Request。 -
取消隐藏行 — 请求体与 隐藏行 相同;响应相同,状态为 “Rows unhidden”。
-
分组行 — 请求体与 隐藏行 相同;响应状态为 “Rows grouped”。
-
取消分组行 — 请求体与 隐藏行 相同;响应状态为 “Rows ungrouped”。
所有操作均需有效的 OAuth 2.0/JWT 访问令牌及相应版本的 SDK。