Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jasandov
Regular Visitor

PowerBI Rest API unable to export PDF with Correct Bookmark

I'm unable to export a report with correct bookmarks when using the Rest API. I am able to get the report, but the correct filters are not set. (This is for an embedded app, and I am using the powerbi javascript library to capture the bookmark state ) I have been able to test my parameters using the "Power Automate" service, and I am able to obtain the report with the correct filters/bookmarks from that service. Here is a code snippet of what I believe to be the culprit:

 

        private async Task<string> PostExportRequest(
            Guid reportId,
            Guid workspaceId,
            FileFormat format,
            IList<string> pageNames,
            PageBookmark bookmark)
        {
            string pageName = pageNames[0];
            try
            {
                var pbiReport = await pbiClient.Reports.GetReportInGroupAsync(workspaceId, reportId);
                var powerBIReportExportConfiguration = new PowerBIReportExportConfiguration
                {
                    Settings = new ExportReportSettings
                    {
                        Locale = "en-us",
                    },
                    DefaultBookmark = new PageBookmark(bookmark.State),
                    Pages = new List<ExportReportPage>() { new ExportReportPage(pageName)},
                    Identities = new List<EffectiveIdentity> { new EffectiveIdentity(username: SPN_ObjectId, datasets: new List<string> { pbiReport.DatasetId }) },
                };

                    var exportRequest = new ExportReportRequest
                    {
                        Format = format,
                        PowerBIReportConfiguration = powerBIReportExportConfiguration
                    };
    
                    var export = await pbiClient.Reports.ExportToFileInGroupAsync(workspaceId, reportId, exportRequest);
                    return export.Id;
            }
            catch (HttpOperationException ex)
            {
                _telemetryClient.TrackException(ex);
                throw ex;
                
            }

 

 

 

 

 

1 REPLY 1
Anonymous
Not applicable

Hi @jasandov 

I found an API introduction about bookmark, maybe you can refer to it .

https://docs.microsoft.com/en-us/javascript/api/overview/powerbi/report-bookmarks

 

Best Regards

Community Support Team _ Ailsa Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.