gpt4 book ai didi

java - smartsheet cell.getFormat() 返回 null

转载 作者:行者123 更新时间:2023-11-30 07:08:59 25 4
gpt4 key购买 nike

我使用 Java Smartsheet API。

根据Smartsheet文档

"Formatting data can optionally be included for columns, rows, and cells by adding the “include=format” query string parameter to any API operation that returns any of those objects (for example, GET /sheets/{sheetId}, GET sheets/{sheetId}/rows/{rowId}, etc.). When this parameter is included, objects that contain non-default formatting will include a format property. Objects which do not have any non-default format settings applied will exclude this property."

我使用以下构造函数创建类 SmartSheetTableModel:

private SmartSheetTableModel(long sheetId, EnumSet<SheetInclusion> includes, EnumSet<ObjectExclusion> excludes, Set<Long> rowIds, Set<Integer> rowNumbers, Set<Long> columnIds, Integer pageSize, Integer page) throws SmartsheetException {
this.sheet = smartsheet.getSmartsheet().sheetResources().getSheet(sheetId, includes, excludes, rowIds, rowNumbers, columnIds, pageSize, page);
}

这里我用 FORMAT 参数调用它:

SmartSheetTableModel sheet = new SmartSheetTableModel.Builder(id).setIncludes(EnumSet.of(SheetInclusion.FORMAT, SheetInclusion.COLUMN_TYPE, SheetInclusion.FILTERS)).setRowNumbers(new HashSet<>(Arrays.asList(new Integer[] {1, 2}))).build();

尽管提供了 FORMAT 参数,但对行、列和单元格的 getFormat() 调用始终返回 null。然而,在网页表中,我看到行有不同的颜色。

有什么想法吗?

最佳答案

好的,我发现 Smartsheet 中的行可能具有条件格式。

关于java - smartsheet cell.getFormat() 返回 null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39525962/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com