Forum Discussion

pyskaty's avatar
pyskaty
Frequent Visitor
5 years ago

Export to excel with RLS and USERCULTURE (power bi embedded)

Hi guys,

I have a strange problem with passing culture to "export to excel" function in power bi embedded scenario.

 

Environment: 

Report published to service and displayed on my web using embed scenario. I'm using RLS (one of rules uses USERCULTURE() to filter some data). I'm passing culture when embedding report in JavaScript

const config: any = {
      type: 'report',
      tokenType: pbi.models.TokenType.Embed,
      accessToken: accessToken.token,
      embedUrl: accessToken.embedUrl,
      pageView: 'fitToWidth',
      id: accessToken.reportId,
      permissions: pbi.models.Permissions.All,
      filters,
      settings: {
        filterPaneEnabled: false,
        navContentPaneEnabled: false,
        background: pbi.models.BackgroundType.Transparent,
        localeSettings: {
          language: this.userSettings.language,  // en, es, ...
          formatLocale: this.userSettings.language,
        }
      },
    };

return new pbi.service.Service(pbi.factories.hpmFactory,
      pbi.factories.wpmpFactory, pbi.factories.routerFactory)
      .embed(element, config) as Report;


Everything work fine until user try to export data to excel (using context menu on visual). Then culture is always set to 'en-US' regarding user's locale and sent config. 

 

Is there any way to configure "export to excel" to use given culture and not default one? Thanks in advance. 

 

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi pyskaty 

    I didnt embed report in JavaScript like you did, so I dont quite understand the result you provided .

    In Power BI service , we set the language in Settings, and there seems to be no language setting for export data in visual .

    Maybe you can try to change the language setting in the Settings, and then look at the result ?

     

    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.

    • pyskaty's avatar
      pyskaty
      Frequent Visitor

      Hi Anonymous 

      Setting static language in power bi servcie oraz report will not resolve my problem. I have multi language environment where users use different cultures (en-US, pl-PL and so on). I pass culture as parameter when embedding report in my app and it works - except 'export to excel' - where culture is alwasy set to en-US.

  • Hello, 

    We have the same problem.

    Have you found a solution or created a ticket for this bug?

    Regards