我必须从 PowerBI 视觉对象中导出所有数据。
我设法使用库 powerbi.js ( https://github.com/Microsoft/PowerBI-JavaScript/wiki/Export-Data ) 并设法实现以下解决方案:
report.page("ReportSection").getVisuals()
.then(function(visuals) {
return visuals.find(function (visual) { return visual.name === "829c5bdfe33aba301b32" });
}).then(function(emailVisual) {
return emailVisual.exportData(models.ExportDataType.Summarized)
}).then(function(result) {
console.log(result.data.length)
});
但是,因为视觉对象(它是一个表)使用延迟加载来加载所有条目,所以当我导出数据时 - 它只导出当前加载到视觉对象中的记录。
要加载更多数据,我需要向下滚动表格,然后再次调用上面的代码。
是否有一种以编程方式一次导出所有数据的解决方案?
最佳答案
尝试修改您的代码以
返回 emailVisual.exportData(models.ExportDataType.Underlying)
这应该为您提供所有数据,而不仅仅是当时视觉中显示的数据
关于javascript - 从 Power BI Visual 以编程方式导出所有数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49917871/