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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
emourits
New Member

ExportTo API: Locale setting not used

I'm using this API to export an embedded report to pdf and powerpoint: https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to

 

My users are based in the netherlands so I choose to hardcode 'nl-NL' as the locale for now. Unfortunately this setting does not result in a pdf with values in dutch culture settings (date and number formatting).

 

The (embedded) report is rendered correctly and switching my browsers culture also changes the formatting.

 

I've tried different locale strings: "nl", "nl-NL" and "nl-nl"

My code looks like this:

var effectiveIdentities = GetEffectiveIdentities(groupId, report.DatasetId);
            var powerBiReportExportConfiguration = new PowerBIReportExportConfiguration
            {
                Settings = new ExportReportSettings
                {
                    Locale = "nl-nl",
                    IncludeHiddenPages = false
                },
                Identities = effectiveIdentities,
                Pages = pages.OrderBy(x => x.Order).Select(pn => new ExportReportPage(pn.Name)
                {
                    Bookmark = new PageBookmark(state: filters)
                }).ToList()
            };

            var paginatedReportExportConfiguration = new PaginatedReportExportConfiguration(effectiveIdentities);
            return pbiClient.Reports.ExportToFileInGroup(groupId,
                reportId,
                new ExportReportRequest(fileFormat, powerBiReportExportConfiguration, paginatedReportExportConfiguration));

 

What am I doing wrong? Or is this a bug in the API?

1 ACCEPTED SOLUTION

We suspect that there's an issue with locale in "Export to File" REST API when your report resides on a Gen1 capacity.

We recommend upgrading the capacity to Gen2 where this feature works as expected.

View solution in original post

7 REPLIES 7
emourits
New Member

It's still not working. I've removed everything non essential to simplify things:

 var effectiveIdentities = GetEffectiveIdentities(groupId, report.DatasetId);
            var powerBiReportExportConfiguration = new PowerBIReportExportConfiguration
            {
                Settings = new ExportReportSettings
                {
                    Locale = "nl-nl",
                    IncludeHiddenPages = false
                },
                Identities = effectiveIdentities,
            };

            return pbiClient.Reports.ExportToFileInGroup(groupId,
                reportId,
                new ExportReportRequest(fileFormat, powerBiReportExportConfiguration));

 

I don't see a reason it won't work for you, but it might help to see the request body as it was sent in the network (for example using fiddler traces).

Also if you can please share the request ID as returned from Power BI it might help us find the reason.

The fiddler trace:

POST https://api.powerbi.com/v1.0/myorg/groups/9652bddc-b890-4256-a219-900fec61378c/reports/116623fd-2e69-4af1-9f9a-30b17b36feec/ExportTo HTTP/1.1
Host: api.powerbi.com
Authorization: Bearer xxxxxx
User-Agent: FxVersion/6.0.121.56705 OSName/Windows OSVersion/Microsoft.Windows.10.0.19044 Microsoft.PowerBI.Api.PowerBIClient/4.1.01803.0001
Request-Context: appId=cid-v1:aa7a3e4e-095d-4072-8760-2b750dbd937a
Request-Id: |d6785cbd6c5d4a4e026eb4d584d56e8c.1772c6e038dc6cee.
traceparent: 00-d6785cbd6c5d4a4e026eb4d584d56e8c-1772c6e038dc6cee-00
Content-Type: application/json; charset=utf-8
Content-Length: 382

{
  "format": "PDF",
  "powerBIReportConfiguration": {
    "settings": {
      "locale": "nl-nl",
      "includeHiddenPages": false
    },
    "identities": [
      {
        "username": "xxxx",
        "datasets": [
          "6b6c16c4-cef3-410c-b4e4-1d2c655e5466"
        ],
        "roles": [
          "Reader"
        ]
      }
    ]
  }
}

The ID of the Export is: MS9CbG9iSWRWMi1lODA3ZjEzZC1lZmEwLTQ3MzktYmJhYS05Mjg3MzE4MTFkOWNPU28zVEx4THB1RGF5eVd6NWFkM1JqSzJMWUtNVTVZY21WY3M0MFZUaWFjPS4=

 

I'll try and get the Fiddler trace working and respond with that later.

We suspect that there's an issue with locale in "Export to File" REST API when your report resides on a Gen1 capacity.

We recommend upgrading the capacity to Gen2 where this feature works as expected.

Yes, upgrading to Gen2 fixed our locale problem. Thank you for your help.

AmosHersch
Microsoft Employee
Microsoft Employee

Hi,

 

Please don't create an export request with both powerbiReportExportConfiguration and paginatedReportExportConfiguration. you should specify only one of them based on the type of your report. 

I verified Locale is working as expected.

 

Thanks,

Amos

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors