[英]Power BI Custom theme file is not getting applied with Angular
We are using pbi-client to embed pbi report in our angular app.我们正在使用 pbi-client 在我们的 angular 应用程序中嵌入 pbi 报告。 We are passing custom theme file with embed configuration as well as we tried to apply it on the pbi report load.我们正在传递带有嵌入配置的自定义主题文件,并尝试将其应用于 pbi 报告加载。 It seems custom theme file is not getting override the default theme of pbi.似乎自定义主题文件没有覆盖 pbi 的默认主题。 Please find below code:请找到以下代码:
const embedConfig = { type: 'report', embedUrl: embedUrl + '?' 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 }; + 'xxxxId=' + xxxxId + '&yyyyId=' + yyyyId,accessToken:embedToken,权限:models.Permissions.All,tokenType:models.TokenType.Embed,主题:{themeJson:powerbiTheme},viewMode:models.ViewMode.View }; 2. theme file after report load: self.report.applyTheme({theme:powerbiTheme}); 2.报表加载后的主题文件:self.report.applyTheme({theme:powerbiTheme});
Please follow the below code snippets to apply custom theme to the Power BI report:请按照以下代码片段将自定义主题应用于 Power BI 报告:
const theme = require("../custom-theme.json");
themeJson
property of theme
property in embedConfig
object:分配主题themeJson
的财产theme
财产embedConfig
对象: 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请参考文档: https : //docs.microsoft.com/javascript/api/overview/powerbi/apply-report-themes
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.