Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
SFerro
New Member

Is there any way to fit the Report/Dashboard to our windows?

Hello,

 

We are using JavaScript API to integrate the Power BI reports in our .net web application. As provided in the demo (https://microsoft.github.io/PowerBI-JavaScript/demo/code-demo/index.html#), we are using div to render reports/dashboards. We are supposed to define the height of the reports/dashboards in pixels but we want them to use the available space on being rendered.

Is there any way to fit the report/dashboard to our windows? 

 

Thanks

1 ACCEPTED SOLUTION
Eric_Zhang
Employee
Employee


@SFerro wrote:

Hello,

 

We are using JavaScript API to integrate the Power BI reports in our .net web application. As provided in the demo (https://microsoft.github.io/PowerBI-JavaScript/demo/code-demo/index.html#), we are using div to render reports/dashboards. We are supposed to define the height of the reports/dashboards in pixels but we want them to use the available space on being rendered.

Is there any way to fit the report/dashboard to our windows? 

 

Thanks


@SFerro

You could set fitToWidth in the embedding configuration.

    var config = {
        type: 'dashboard',
        tokenType: models.TokenType.Embed,
        accessToken: accessToken,
        embedUrl: embedUrl,
	pageView: "fitToWidth",
        id: embedDashboardId
    };

View solution in original post

1 REPLY 1
Eric_Zhang
Employee
Employee


@SFerro wrote:

Hello,

 

We are using JavaScript API to integrate the Power BI reports in our .net web application. As provided in the demo (https://microsoft.github.io/PowerBI-JavaScript/demo/code-demo/index.html#), we are using div to render reports/dashboards. We are supposed to define the height of the reports/dashboards in pixels but we want them to use the available space on being rendered.

Is there any way to fit the report/dashboard to our windows? 

 

Thanks


@SFerro

You could set fitToWidth in the embedding configuration.

    var config = {
        type: 'dashboard',
        tokenType: models.TokenType.Embed,
        accessToken: accessToken,
        embedUrl: embedUrl,
	pageView: "fitToWidth",
        id: embedDashboardId
    };

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.