public void CreateReportRedirectSharedDatasets() { var rs = GetReportingService(); var dataSources = new Dictionary <string, string>(); dataSources.Add("AdventureWorks", "/Data Sources/AdventureWorks"); var dataSetNames = new[] { "EmployeeSalesDetail", "EmployeeSalesYearOverYear", "EmpSalesMonth", "SalesEmployees" }; var dsService = new SharedDatasetService(rs); var dataSets = new Dictionary <string, string>(); foreach (var dataSetName in dataSetNames) { dsService.Create(dataSetName, "/ReportFolder", SharedDatasetPath + dataSetName + ".rsd", string.Empty, false); dataSets.Add(dataSetName, "/ReportFolder/" + dataSetName); } var service = new ReportService(rs); service.Create("Employee sales summary", "/ReportFolder", EmployeeSalesSummaryPath, "My description", false, dataSources, dataSets); var dsRef = rs.GetItemReferences("/ReportFolder/Employee sales summary", "DataSet"); Assert.That(dsRef.Count(), Is.EqualTo(4)); foreach (var dsRefItem in dsRef) { Assert.That(dsRefItem.Reference, Is.Not.Null.Or.Empty); } }
public void CreateSharedDataset() { var rs = GetReportingService(); var service = new SharedDatasetService(rs); service.Create("EmployeeSalesDetail", "/SharedDatasetFolder", SharedDatasetPaths[0], string.Empty, false); Assert.That(rs.GetItemType("/SharedDatasetFolder/EmployeeSalesDetail"), Is.EqualTo("DataSet")); }
public void CreateSharedDatasetRedirectMissingDataSource() { var rs = GetReportingService(); var ds = new Dictionary <string, string>(); var service = new SharedDatasetService(rs); var error = false; service.MessageSent += (o, e) => error |= e.Level == MessageEventArgs.LevelOption.Error; Assert.Catch <InvalidOperationException>(() => service.Create("EmployeeSalesDetail", "/SharedDatasetFolder", SharedDatasetPath, string.Empty, false, "AdventureWorks", ds)); Assert.That(error, Is.True); }
public void CreateVisibleSharedDataset() { var rs = GetReportingService(); var service = new SharedDatasetService(rs); service.Create("EmployeeSalesDetail", "/SharedDatasetFolder", SharedDatasetPaths[0], "My description", false); Assert.That(rs.GetItemType("/SharedDatasetFolder/EmployeeSalesDetail"), Is.EqualTo("DataSet")); var properties = rs.GetProperties("/SharedDatasetFolder/EmployeeSalesDetail", new[] { new Property() { Name = "Hidden" } }); Assert.That(properties[0].Value, Is.EqualTo(false.ToString())); }
public void CreateSharedDatasetRedirectDataSource() { var rs = GetReportingService(); var ds = new Dictionary <string, string>(); ds.Add("AdventureWorks", "/Data Sources/AdventureWorks"); var service = new SharedDatasetService(rs); service.Create("EmployeeSalesDetail", "/SharedDatasetFolder", SharedDatasetPaths[0], "My description", false, "AdventureWorks", ds); var dsRef = rs.GetItemDataSources("/SharedDatasetFolder/EmployeeSalesDetail"); Assert.That(dsRef.Count(), Is.EqualTo(1)); Assert.That(dsRef[0].Item, Is.TypeOf <DataSourceReference>()); Assert.That((dsRef[0].Item as DataSourceReference).Reference, Is.EqualTo("/Data Sources/AdventureWorks")); }
public SharedDatasetParser(SharedDatasetService sharedDatasetService) { this.sharedDatasetService = sharedDatasetService; ChildrenParsers = new List <IParser>(); }