Forum Discussion
Modifying the Layout file that is embedded in a pbix file
- Anonymous5 years ago
I was struggling with this issue recently, and my solution is the following:
- Change the extension from ".pbix" to ".zip"
- Do not unzip the ".zip" file during this process
- Extract the "Layout" file from the "Report" folder in the ".zip" file
- Open the "Layout" file with Notepad++. (VERY IMPORTANT)
- Make your modifications in the Layout file
- Substitute the old "Layout" file with the new one
- Delete "SecurityBindings" file in the ".zip" file
- In the [Contents_type].xml delete the following text:
"<Override PartName="/SecurityBindings" ContentType="" />"
- Change the extension from ".zip to ".pbix"
- The file will open without breaks
Hope it helps!
Hi instinct46 ,
Could you explain where and how one should exactly run this code? In my case, I don't want to change the lay-out file but I want to change the datamodelschema to programmatically add measures.
Thanks in advance.
I don't believe that code is needed if you make edits with Notepad ++ and not Notepad. I kept getting a corrupt file despite thinking I'd followed the instructions exactly, then I came across this and realized Notepad was the culprit (and I later noted that the instructions above explicity say in all caps that it's VERY IMPORTANT to use Notepad ++ to make edits, yet I had somehow overlooked them 😀).
I hope this is what is causing your issue as well!