如何获取OData连接信息

获取OData连接信息

开发者有时可能需要从Excel文件中提取OData信息。Aspose.Cells for Python via .NET 提供了Workbook.data_mashup属性,该属性返回Excel文件中的DataMashup信息。这些信息由DataMashup类表示。DataMashup类提供了power_query_formulas属性,该属性返回PowerQueryFormulaCollction集合。通过PowerQueryFormulaCollction,可以访问PowerQueryFormulaPowerQueryFormulaItem

以下代码片段演示了使用这些类来检索OData信息。

以下代码片段中使用的源文件,请参考附件。

源文件

示例代码

控制台输出

Connection Name: Orders

Name: Source

Value: OData.Feed("https://services.odata.org/V3/Northwind/Northwind.svc/", null, [Implementation="2.0"])

Name: Orders_table

Value: Source{[Name="Orders",Signature="table"]}[Data]