Excel.LinkedEntityCellValue interface
表示一个值,其属性派生自服务。
注解
使用方
- Excel.LinkedEntityCellValueLoadedEventArgs: linkedEntityCellValue
- Excel.LinkedEntityLoadServiceResult: 实体
- Excel.PlaceholderErrorCellValue: target
- Excel.Workbook: getLinkedEntityCellValue
示例
// Creates a linked entity cell value with properties and a card layout.
// This is typically returned from a linked entity load service function.
const productLinkedEntity: Excel.LinkedEntityCellValue = {
type: "LinkedEntity",
text: "Chai",
id: {
entityId: "P1",
domainId: "products",
serviceId: 268436224, // Service ID used by Excel to identify linked entity cell values associated with an add-in.
culture: "en-US"
},
properties: {
"Product Name": {
type: "String",
basicValue: "Chai"
},
"Unit Price": {
type: "FormattedNumber",
basicValue: 18,
numberFormat: "$* #,##0.00"
},
Discontinued: {
type: "Boolean",
basicValue: false
}
},
layouts: {
compact: {
icon: "ShoppingBag"
},
card: {
title: { property: "Product Name" },
sections: [
{
layout: "List",
properties: ["Product Name", "Unit Price", "Discontinued"]
}
]
}
}
};
属性
| basic |
表示将为具有此值的单元格返回 |
| basic |
表示将为具有此值的单元格返回 |
| id | 表示在此值中提供信息的服务源。 |
| layouts | 表示此链接实体视图的布局信息。 |
| properties | 表示此链接实体的属性及其元数据。 |
| provider | 表示描述在此 |
| text | 表示呈现具有此值的单元格时显示的文本。 |
| type | 表示此单元格值的类型。 |
属性详细信息
basicType
表示将为具有此值的单元格返回 Range.valueTypes 的值。
basicType?: RangeValueType.error | "Error";
属性值
error | "Error"
注解
basicValue
表示将为具有此值的单元格返回 Range.values 的值。 通过 valuesAsJson 属性访问时,此字符串值与 en-US 区域设置一致。 通过 valuesAsJsonLocal 属性访问时,此字符串值与用户的显示区域设置一致。
basicValue?: "#VALUE!" | string;
属性值
"#VALUE!" | string
注解
id
layouts
properties
表示此链接实体的属性及其元数据。
properties?: {
[key: string]: EntityPropertyType;
};
属性值
{ [key: string]: Excel.EntityPropertyType; }
注解
provider
表示描述在此 LinkedEntityCellValue中提供数据的服务的信息。 此信息可用于实体卡中的品牌打造。
provider?: CellValueProviderAttributes;