我们如何在 Microsoft Excel Graph API 中创建没有标题的表格?

问题描述

我需要在 Microsoft Excel 中使用 Graph API 创建一个表格。

https://docs.microsoft.com/en-us/graph/api/worksheet-post-tables?view=graph-rest-1.0

根据上述文档,如果我们在创建表 API 中将 hasHeaders 字段设置为 false,它应该创建一个没有标题的表。但是,我仍然得到一张带有标题的表格。我在下面添加了屏幕截图。

enter image description here

那么如何在 Excel 中创建没有标题的表格?

解决方法

如果我正确阅读了文档,即使您的源代码没有标题,Excel 也会自动创建标题: enter image description here

创建表后,您需要class MySinglton { private static volatile MySinglton instance; private MySinglton() {} public static MySinglton getInstance() { if (instance == null) { synchronized (MySinglton.class) { if (instance == null) { instance = new MySinglton(); } } } return instance; } } 您创建的Update对象,并将WorkbookTable设置为ShowHeaders https://docs.microsoft.com/en-us/graph/api/table-update?view=graph-rest-1.0&tabs=http

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...