public override void PublishReports(string srcFolder, string destFolder) { var di = new DirectoryInfo(srcFolder); var files = di.GetFiles("*.rdl") .Concat(di.GetFiles("*.rsmobile")) .Concat(di.GetFiles("*.kpi")) .Concat(di.GetFiles("*.pbix")); foreach (FileInfo fi in files) { var displayName = fi.Name.Substring(0, fi.Name.IndexOf(fi.Extension)); var reportPath = PublishReport(fi.FullName, displayName, destFolder); switch (fi.Extension) { case ".rdl": ExistingReports.Add(reportPath); break; case ".rsmobile": ExistingMobileReports.Add(reportPath); break; case ".kpi": ExistingKpis.Add(reportPath); break; case ".pbix": if (reportPath.ToLowerInvariant().Contains("embedded")) { SetPbiReportCredentialsForEmbedded(reportPath); ExistingEmbeddedPowerBIReports.Add(reportPath); } else if (reportPath.ToLowerInvariant().Contains("directquery")) { SetPbiReportCredentialsForEmbedded(reportPath); ExistingDirectQueryPowerBIReports.Add(reportPath); } else { SetPbiReportCredentials(reportPath); ExistingPowerBIReports.Add(reportPath); } break; } } ; }
private void GetExistingPowerBIReports() { var reports = GetFolderContent(this.WorkingFolder).Where(x => x.Type == CatalogItemType.PowerBIReport); foreach (var report in reports) { if (report.Name.ToLowerInvariant().Contains("embedded")) { ExistingEmbeddedPowerBIReports.Add(report.Path); } else if (report.Name.ToLowerInvariant().Contains("directquery")) { ExistingDirectQueryPowerBIReports.Add(report.Path); } else { ExistingPowerBIReports.Add(report.Path); } } }