Excel.LinkedEntityDataDomainCreateOptions interface
表示用于创建 LinkedEntityDataDomain 要添加到 LinkedEntityDataDomainCollection的对象的选项。
注解
Excel Web 版不支持此界面。
使用方
示例
// Registers linked entity data domains when the add-in loads.
await Excel.run(async (context) => {
const productsDomainOptions: Excel.LinkedEntityDataDomainCreateOptions = {
dataProvider: "Contoso",
id: "products",
name: "Products",
// ID of the custom function called by Excel to resolve or refresh linked entity cell values.
loadFunctionId: "CONTOSOLOADSERVICE",
// periodicRefreshInterval is only required when supportedRefreshModes contains "Periodic".
periodicRefreshInterval: 300,
// Manual refresh mode is always supported, even if unspecified.
supportedRefreshModes: [
Excel.LinkedEntityDataDomainRefreshMode.periodic,
Excel.LinkedEntityDataDomainRefreshMode.onLoad
]
};
// Add the data domain to the collection to register it.
context.workbook.linkedEntityDataDomains.add(productsDomainOptions);
await context.sync();
});
属性
| data |
指定链接实体数据域的数据提供程序的名称。 |
| id | 指定链接实体数据域的 ID。 此 ID 在此 Office 加载项定义的所有链接实体数据域中必须唯一。 |
| load |
指定将按需调用的自定义函数的 ID 以解析或刷新 |
| name | 指定链接实体数据域的名称。 此名称在此 Office 加载项定义的所有链接实体数据域中必须唯一。 |
| periodic |
指定自动刷新此链接实体数据域的对象的频率(以秒 |
| supported |
指定链接实体数据域支持的所有刷新模式。 默认值为 |
属性详细信息
dataProvider
id
指定链接实体数据域的 ID。 此 ID 在此 Office 加载项定义的所有链接实体数据域中必须唯一。
id: string;
属性值
string
注解
Excel web 版不支持此属性。
loadFunctionId
指定将按需调用的自定义函数的 ID 以解析或刷新 LinkedEntityCellValue 此链接实体数据域的对象。 有关详细信息,请参阅 为自定义函数自动生成 JSON 元数据:ID。
loadFunctionId: string;
属性值
string
注解
Excel web 版不支持此属性。
name
指定链接实体数据域的名称。 此名称在此 Office 加载项定义的所有链接实体数据域中必须唯一。
name: string;
属性值
string
注解
Excel web 版不支持此属性。
periodicRefreshInterval
指定自动刷新此链接实体数据域的对象的频率(以秒 LinkedEntityCellValue 为单位)。 最小有效值为 300。 如果数组包含值“Periodic”,则 supportedRefreshModes 需要此属性。 仅当链接实体数据域的设置为 refreshMode “定期”时,此属性才适用。
periodicRefreshInterval?: number;
属性值
number
注解
Excel web 版不支持此属性。
supportedRefreshModes
指定链接实体数据域支持的所有刷新模式。 默认值为 ["Manual"],即使未指定,也始终受支持。 在下次打开工作簿时,将作为链接实体数据域的默认刷新模式加载工作簿中保存的刷新模式。 如果刷新模式未保存在工作簿中,则数组中的第一个值设置为链接实体数据域的默认刷新模式。 如果数组的值为“Periodic”,则还必须为链接的实体数据域设置该 periodicRefreshInterval 属性。
supportedRefreshModes?: Excel.LinkedEntityDataDomainRefreshMode[];
属性值
注解
Excel web 版不支持此属性。