I have a report template which is built in Power BI Desktop and is saved as .pbix or .pbit file. This template uses DirectQuery SQL database as data source, whereas server address and database name are extracted to parameters. There is also a parameter which holds a ReportId
, which is used in queries.
I also have a C# application, which is supposed to generate Power BI Desktop reports from this template.
How can create a report with specific parameters programmatically?
Something like Power BI Desktop does itself when you open .pbit template file, enter parameters and it generates .pbix document.
I didn't find any SDK \ Interop libraries for Power BI Desktop.
I have tried to open a document as ZIP, but DataModel
file is archived, and therefore not a well-formed XML.
I have also tried to extract this parameters to JSON file and load it as a data source, but relative paths are not supported by Power BI.
ReportId
to a report-level filter, but I also have database address and name. Power BI Online sounds like the best option here, I think I will look into this. – Bentwood