Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi
I am trying to export report , with applied filter and for some page. i am getting error "Operation returned an invalid status code 'BadRequest'"
Below is my code.
var urlFilter = "Distry=CMC";
ExportReportPage pages1w3 = new ExportReportPage("ReportSection0");
IList<ExportReportPage> pageNames = new List<ExportReportPage> { pages1w3 };
var powerBIReportExportConfiguration = new PowerBIReportExportConfiguration
{
Settings = new ExportReportSettings
{
Locale = "en-us",
},
// Note that page names differ from the page display names
// To get the page names use the GetPages REST API
Pages = pageNames,
// ReportLevelFilters collection needs to be instantiated explicitly
ReportLevelFilters = !string.IsNullOrEmpty(urlFilter) ? new List<ExportFilter>() { new ExportFilter(urlFilter) } : null,
};
var exportRequest = new ExportReportRequest
{
Format = FileFormat.ACCESSIBLEPDF,
PowerBIReportConfiguration = powerBIReportExportConfiguration,
};
var export = client.Reports.ExportToFile(ReportId, exportRequest);
Any help appreated..
Currently you can only supply ONE report level filter.
You have to use the report page ID, not the name. Use the API sandbox to test your API calls.
Reports - Export To File - REST API (Power BI Power BI REST APIs) | Microsoft Docs
@lbendlin thanks for your response. I am able to get single page. but filtering is not applying..Any suggestions.. I want to apply multiple filter options.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
2 | |
2 | |
1 | |
1 |
User | Count |
---|---|
20 | |
3 | |
2 | |
2 | |
2 |