We are using pbi-client to embed pbi report in our angular app. We are passing custom theme file with embed configuration as well as we tried to apply it on the pbi report load. It seems custom theme file is not getting override the default theme of pbi. Please find below code:
const embedConfig = { type: 'report', embedUrl: embedUrl + '?' + 'xxxxId=' + xxxxId + '&yyyyId=' + yyyyId, accessToken: embedToken, permissions: models.Permissions.All, tokenType: models.TokenType.Embed, theme: {themeJson: powerbiTheme}, viewMode: models.ViewMode.View }; 2. theme file after report load: self.report.applyTheme({theme:powerbiTheme});
Please follow the below code snippets to apply custom theme to the Power BI report:
const theme = require("../custom-theme.json");
themeJson
property of theme
property in embedConfig
object: embedConfig: IReportEmbedConfiguration = { type: "report", embedUrl: "EMBED URL", tokenType: models.TokenType.Embed, accessToken: "ACCESS TOKEN", settings: "SETTINGS", theme: { themeJson: theme } };
const theme = require("../custom-theme.json");
self.report.applyTheme({ themeJson: theme });
Please refer docs: https://docs.microsoft.com/javascript/api/overview/powerbi/apply-report-themes
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.