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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Extract Layout using script

Hi,

 

I would like to extract all information provided during creating visual  (e.g. Filter visual has name, font size, font color, font size , Alt text , etc) from all tabs using script. 

 

The motive is for Accessibility testing. Exported csv/xml file has all information about visuals and i can easily identify that which visual has not enough font size, color contrast, missing Alt text ,etc are not complaint with WCAG 2.0 AA / AAA.

 

Looking for any such script which extract these information from power bi.

 

Thanks,

Dipan

1 REPLY 1
Anonymous
Not applicable

I really appreciate your effort. It is really important to test these and ensure that the web apps, reports, dashboards are more inclusive. Having said that, I don't know if there is any script that does this, but if you know any programming language like Python, you could write a script and parse the report layout file to this python script and get the relevant output.

 

The approach is, once you create your report, do the following...

 

1) Make a copy of your report PBIX file.

2) Rename the extension of the copy from '.pbix' to '.zip'.

3) Then, open the zip (compressed file).

4) It will have a folder named "Report"

5) If you open the folder, there will be a file named "layout".

6) If you open this file using any text editor or code editor like VS code, you will be able to see all the report details like sheets, visuals, and all the properties of the visuals in your report. It looks like a ".json" file, but I am not sure.

 

At this level, you have all the details about your report, visuals, properties of visuals like font sizes, colors, etc... Though it is in human-readable form, it is not comprehensible or not very easy to find the properties. So it is better to write a script in Python or if possible import it into another Power BI Desktop file, do some transformations and try to make sense of it.

 

Disclaimer: I don't know if there is a better way. But if you don't know about any other option, you could approach it this way.

 

@Greg_Deckler 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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