Forum Discussion
API Export with captured bookmark state only has current page filters
- 3 years ago
I found my issue - I needed to update powerbi.js. Exported pdf now has page level filters from captured bookmark.
https://github.com/microsoft/PowerBI-JavaScript/tree/master/dist
yes defaultBookmark. c# server side code...
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?.Select(pn => new ExportReportPage(pn)).ToList(),
DefaultBookmark = new PageBookmark(null, bookmark.state),
Identities = identities
};
var exportRequest = new ExportReportRequest
{
Format = format,
PowerBIReportConfiguration = powerBIReportExportConfiguration,
};
// The 'Client' object is an instance of the Power BI .NET SDK
var export = await client.Reports.ExportToFileInGroupAsync(groupId, reportId, exportRequest);
// Save the export ID, you'll need it for polling and getting the exported file
var result = new ExportRequest()
{
ExportId = export.Id,
ReportName = report.Name,
ReportId = reportId,
GroupId = groupId
};
return result;