Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello everyone,
I am trying to modify a pbit archive in java in my application.
The point is to update the data source of a pbit without using any PowerBI application so I have to modify the DataModelSchema entry.
My problem is : when I read the file with an InputStream and display it in the console, there are blank spaces added between each letter so I am not able to search and replace the right string. Even if I add artificially blank spaces in my string.
For example if i search "content" or even "c o n t e n t", it never finds it.
That problem never appears when I read "normal" .zip archives.
An overview of my ouput when i read the file with additional blank spaces :
So I would like to get to know if there is a special encoding in pbit templates which might add special spaces or whatever if there is a way to read it properly.
Thanks for your help,
Regards
J.MARQUE
Thank you for your answer,
Unfortunately, due to the difficulty to unzip/zip a pbit properly, I think I will not have other option than using Power API.
Regards
J.MARQUE
Hi @Anonymous
Yes, Power API is the better choice. Actually, Power BI should not allow make changes to the pbix/pbit file except themes JSON files in it. If you make some changes to other files in the pbix/pbit and then re-zip it and restore it to a pbix/pbit file,This file will be destroyed because of unexpected character error like as the following.
Best Regards
Caiyun Zheng
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
Compression stores the same information in a more efficient way by removing redundancy. The JSON file of DataModeSchema has been compressed and saved in PBIT, I think it is possible that the compression affects the content you read into Java.
Best Regards
Caiyun Zheng
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.