public override void Execute() { var url = Options["ru"].Values[0]; var folder = Options["rf"].Values[0]; var dataSources = Options["rds"] != null?GetDataSources(Options["rds"].Values.ToArray()) : null; var reportFiles = GetReportFiles(folder); foreach (var reportFile in reportFiles) { var reportPath = FilePath.GetRelativePath(reportFile, folder); // Convert it into a reporting services path. reportPath = "/" + reportPath.Replace("\\", "/").Replace(".rdl", ""); string name; string parent; ReportServiceUtil.SplitPath(reportPath, out name, out parent); ReportServiceUtil.CreateFolder(url, parent); ReportServiceUtil.CreateReport(url, name, parent, dataSources, reportFile); Console.WriteLine("The '{0}' report has been created from the '{1}' definition file.", reportPath, reportFile); } }
public override bool Execute() { // Iterate over all folders. var dataSources = _dataSources == null ? null : (from ds in _dataSources select ds.ItemSpec).ToArray(); foreach (var folderItem in _folders) { // Get the set of report files. var folder = folderItem.ItemSpec; var reportFiles = GetReportFiles(folder); foreach (var reportFile in reportFiles) { var reportPath = FilePath.GetRelativePath(reportFile, folder); // Convert it into a reporting services path. reportPath = "/" + reportPath.Replace("\\", "/").Replace(".rdl", ""); string name; string parent; ReportServiceUtil.SplitPath(reportPath, out name, out parent); ReportServiceUtil.CreateFolder(_options.ReportServerUrl, parent); ReportServiceUtil.CreateReport(_options.ReportServerUrl, name, parent, dataSources, reportFile); Log.LogMessage("The '{0}' report has been created from the '{1}' definition file.", reportPath, reportFile); } } return(true); }
public override void Execute() { var url = Options["ru"].Values[0]; var folder = GetPath(Options["rf"].Values[0]); var definitionFile = Options["rd"].Values[0]; var name = Path.GetFileNameWithoutExtension(definitionFile); var dataSources = Options["rds"] != null?GetDataSources(Options["rds"].Values.ToArray()) : null; ReportServiceUtil.CreateReport(url, name, folder, dataSources, definitionFile); }