The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I receive the following error when we try to use the models.PageView.fitToWidth setting in an embedded dashboard's configuration details. Is there a setting for dashboards? I'm using v2.0.2 of the power bi api
Unable to get property 'fitToWidth' of undefined or null reference
var config = { type: 'dashboard', tokenType: models.TokenType.Embed, accessToken: accessToken, embedUrl: embedUrl, pageView: models.PageView.fitToWidth, id: embedDashboardId };
Solved! Go to Solution.
@cch1 wrote:
I receive the following error when we try to use the models.PageView.fitToWidth setting in an embedded dashboard's configuration details. Is there a setting for dashboards? I'm using v2.0.2 of the power bi api
Unable to get property 'fitToWidth' of undefined or null reference
var config = { type: 'dashboard', tokenType: models.TokenType.Embed, accessToken: accessToken, embedUrl: embedUrl, pageView: models.PageView.fitToWidth, id: embedDashboardId };
Thanks for reporting that. I can reproduce the same issue. I've found the reason is that the model doesn't contain such "PageView" attribute when trying to debug by "console.log(models);". As a workaround, use the constants "fitToWidth"/"oneColumn"/"actualSize" instead.
@cch1 wrote:
I receive the following error when we try to use the models.PageView.fitToWidth setting in an embedded dashboard's configuration details. Is there a setting for dashboards? I'm using v2.0.2 of the power bi api
Unable to get property 'fitToWidth' of undefined or null reference
var config = { type: 'dashboard', tokenType: models.TokenType.Embed, accessToken: accessToken, embedUrl: embedUrl, pageView: models.PageView.fitToWidth, id: embedDashboardId };
Thanks for reporting that. I can reproduce the same issue. I've found the reason is that the model doesn't contain such "PageView" attribute when trying to debug by "console.log(models);". As a workaround, use the constants "fitToWidth"/"oneColumn"/"actualSize" instead.