public void UsePowerBIReportsEmbeddedStreamNewModel() { var report = PublishUniqueReportOnServer(); Container context = this.ContentManager.PortalAccessorV1.CreateContext(); ICredentials executionCredentails = GetExecutionCredentails(); var pbiReport = context.CatalogItemByPath(report.ReportPath).GetValue() as PowerBIReport; PowerBIClient.SimulatePowerBIReportUsage(executionCredentails, pbiReport, report.OriginalFileName); }
public void UsePowerBIReportsEmbeddedReuseModel() { string report = ContentManager.GetNextCatalogItem("PowerBIReportEmbedded"); Container context = this.ContentManager.PortalAccessorV1.CreateContext(); ICredentials executionCredentails = GetExecutionCredentails(); var pbiReport = context.CatalogItemByPath(report).GetValue() as PowerBIReport; PowerBIClient.SimulatePowerBIReportUsage(executionCredentails, pbiReport, pbiReport.Name); }
public void UsePowerBIReports() { string report = ContentManager.GetNextCatalogItem("PowerBIReport"); var context = this.ContentManager.PortalAccessorV1.CreateContext(); ICredentials executionCredentails = CredentialCache.DefaultNetworkCredentials; if (!String.IsNullOrEmpty(ReportServerInformation.DefaultInformation.ExecutionAccount)) { CredentialCache myCache = new CredentialCache(); Uri reportServerUri = new Uri(ReportServerInformation.DefaultInformation.ReportServerUrl); myCache.Add(new Uri(reportServerUri.GetLeftPart(UriPartial.Authority)), "NTLM", new NetworkCredential(ReportServerInformation.DefaultInformation.ExecutionAccount, ReportServerInformation.DefaultInformation.ExecutionAccountPwd)); executionCredentails = myCache; } PowerBIReport pbiReport = context.CatalogItemByPath(report).GetValue() as PowerBIReport; PowerBIClient.SimulatePowerBIReportUsage(executionCredentails, pbiReport); }