PowerBI ExportReport 流格式

PowerBI ExportReport Stream format

我正在使用具有专业版许可的在线 PowerBI。

在 .Net core 2.1 中使用 PowerBIClient 对象,我能够使用返回流的 ExportReport 函数。

我想将它转换成图像(任何格式)以便我可以进一步使用它。我如何完成这项工作?我的想法正确吗?

恐怕这样不行。 ExportReport returns .pbix 文件,即报表本身,可以在 Power BI Desktop 中打开。没有简单的方法可以实用地将其转换为图像。

您可以将此流保存为 .pbix 文件并尝试在 Power BI Desktop 中打开它。如果导入了数据,或者如果您可以访问数据源,您将能够可视化报告并将其导出为 PDF,但这是手动操作。此外,您可以直接从服务导出报告(到 PowerPoint and PDF)。

您可以尝试自动化 Power BI Desktop(例如使用 this),但我不会为生产系统采用这种方式。

还有一些第三方工具最终可以为您提供帮助(例如 this one)。

您可以 embed Power BI in a desktop application and try some screen capturing magic,但这也不是一个简单易行的解决方案。

您可以在 Power BI Ideas, e.g. Export to PDF via Power BI Embedded API 中提出一个想法或为现有想法投票。

2020 年更新:现在可以导出到文件 API - Export report to PDF, PPTX and PNG files using Power BI REST API (Preview), Reports - Export To File, Reports - Export To File In Group