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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

PowerBI JavaScript library and it's exposed UpdateSettings method

I noticed an underlying problem where the UpdateSettings method exposed by the Javascript library does not actually affect any change to the report specified. I confirmed that the method itself was not failing, just that it essentially wasn’t working. I made sure that I was using the latest version of the library (2.5.0) and even downgraded a minor version to compare and still faced the same issue. I followed the guidelines strictly that were laid out on the Wiki page and tried a few obvious alternatives without any luck. This is in regards to embedding PowerBI in an Iframe.

 

Can anyone provide feedback on why this might not be working?  

 

Here's a code snippet of the function I was calling:

 

 

		let embedContainer = $('#reportContainer')[0];

		let models = window['powerbi-client'].models;

		let defaultLayout = {
			  displayState: {
				    mode: models.VisualContainerDisplayMode.Hidden
			  }
		};

		let pageSize = {
			    type: models.PageSizeType.Custom
		};

		let pageLayout = {
			  defaultLayout: defaultLayout,
			  visualsLayout: {}
		};

		let settings = {
			  filterPaneEnabled: false,
			  navContentPaneEnabled: false,
			  layoutType: models.LayoutType.Custom,
			  customLayout: {
				    pageSize: pageSize,
				    displayOption: models.DisplayOption.FitToPage,
				    pagesLayout: {
					      "ReportSection3": pageLayout
				    }
			  }
		}

		report = powerbi.get(embedContainer);

		report.updateSettings(settings)
			    .catch(function (error) {
				        Log.log(errors);
			    });

 

Status: New
Comments
v-qiuyu-msft
Community Support

Hi @Zev,

 

As I tested, UpdateSettings works fine. Please use https://microsoft.github.io/PowerBI-JavaScript/demo/v2-demo/index.html# to test UpdateSettings with your report to see if the same issue occurs. 

 

Best Regards,
Qiuyun Yu 

qlegoff
Frequent Visitor

On my side, I did succeed to change 'filterPaneEnabled' or 'navContentPaneEnabled' dynamically but I did not succeed to change localeSettings dynamically.

Anonymous
Not applicable

@qlegoff Same here !