private static void CreateReports(ReportingService2010 reportingService, string path)
        {
            if (reportingService == null)
            {
                throw new ArgumentNullException("reportingService");
            }

            if (string.IsNullOrEmpty(path))
            {
                throw new ArgumentException("path");
            }

            foreach (ReportItem report in SetupReportItems)
            {
                string fullPath = string.Format(report.Path, path);
                string parent   = TesterUtility.GetParentPath(fullPath);

                Warning[] warnings;
                reportingService.CreateCatalogItem("Report",
                                                   report.Name,
                                                   parent,
                                                   true,
                                                   report.Definition,
                                                   null,
                                                   out warnings);
            }
        }
        private static void CreateReport(ReportingService2010 reportingService, ReportItem report)
        {
            if (reportingService == null)
            {
                throw new ArgumentNullException("reportingService");
            }

            if (report == null)
            {
                throw new ArgumentNullException("report");
            }

            string parent = TesterUtility.GetParentPath(report.Path);

            ReportingService2010TestEnvironment.CreateFolderFromPath(reportingService, parent);

            Warning[] warnings;

            reportingService.CreateCatalogItem("Report",
                                               report.Name,
                                               parent,
                                               true,
                                               report.Definition,
                                               null,
                                               out warnings);
        }
        private static void CreateDataSources(ReportingService2010 reportingService, string path)
        {
            if (reportingService == null)
            {
                throw new ArgumentNullException("reportingService");
            }

            if (string.IsNullOrEmpty(path))
            {
                throw new ArgumentException("path");
            }

            foreach (DataSourceItem dataSource in SetupDataSourceItems)
            {
                DataSourceDefinition def = new DataSourceDefinition();
                def.ConnectString = dataSource.ConnectString;

                switch (dataSource.CredentialsRetrieval)
                {
                case "Integrated":
                    def.CredentialRetrieval = CredentialRetrievalEnum.Integrated; break;

                case "None":
                    def.CredentialRetrieval = CredentialRetrievalEnum.None; break;

                case "Prompt":
                    def.CredentialRetrieval = CredentialRetrievalEnum.Prompt; break;

                case "Store":
                    def.CredentialRetrieval = CredentialRetrievalEnum.Store; break;
                }

                def.Enabled                              = dataSource.Enabled;
                def.EnabledSpecified                     = dataSource.EnabledSpecified;
                def.Extension                            = dataSource.Extension;
                def.ImpersonateUser                      = dataSource.ImpersonateUser;
                def.ImpersonateUserSpecified             = dataSource.ImpersonateUserSpecified;
                def.OriginalConnectStringExpressionBased = dataSource.OriginalConnectStringExpressionBased;
                def.Password                             = dataSource.Password;
                def.Prompt = dataSource.Prompt;
                def.UseOriginalConnectString = dataSource.UseOriginalConnectString;
                def.UserName           = dataSource.UserName;
                def.WindowsCredentials = dataSource.WindowsCredentials;

                string fullPath = string.Format(dataSource.Path, path);
                string parent   = TesterUtility.GetParentPath(fullPath);

                reportingService.CreateDataSource(dataSource.Name, parent, true, def, null);
            }
        }
        private static void CreateDataSource(ReportingService2010 reportingService, DataSourceItem dataSource)
        {
            if (reportingService == null)
            {
                throw new ArgumentNullException("reportingService");
            }

            if (dataSource == null)
            {
                throw new ArgumentNullException("dataSource");
            }

            DataSourceDefinition def = new DataSourceDefinition();

            def.ConnectString = dataSource.ConnectString;

            switch (dataSource.CredentialsRetrieval)
            {
            case "Integrated":
                def.CredentialRetrieval = CredentialRetrievalEnum.Integrated; break;

            case "None":
                def.CredentialRetrieval = CredentialRetrievalEnum.None; break;

            case "Prompt":
                def.CredentialRetrieval = CredentialRetrievalEnum.Prompt; break;

            case "Store":
                def.CredentialRetrieval = CredentialRetrievalEnum.Store; break;
            }

            def.Enabled                              = dataSource.Enabled;
            def.EnabledSpecified                     = dataSource.EnabledSpecified;
            def.Extension                            = dataSource.Extension;
            def.ImpersonateUser                      = dataSource.ImpersonateUser;
            def.ImpersonateUserSpecified             = dataSource.ImpersonateUserSpecified;
            def.OriginalConnectStringExpressionBased = dataSource.OriginalConnectStringExpressionBased;
            def.Password                             = dataSource.Password;
            def.Prompt = dataSource.Prompt;
            def.UseOriginalConnectString = dataSource.UseOriginalConnectString;
            def.UserName           = dataSource.UserName;
            def.WindowsCredentials = dataSource.WindowsCredentials;

            string parent = TesterUtility.GetParentPath(dataSource.Path);

            ReportingService2010TestEnvironment.CreateFolderFromPath(reportingService, parent);

            reportingService.CreateDataSource(dataSource.Name, parent, true, def, null);
        }
Exemple #5
0
        private static void CreateReport(ReportingService2005 reportingService, ReportItem report)
        {
            if (reportingService == null)
            {
                throw new ArgumentNullException("reportingService");
            }

            if (report == null)
            {
                throw new ArgumentNullException("report");
            }

            string parent = TesterUtility.GetParentPath(report.Path);

            ReportingService2005TestEnvironment.CreateFolderFromPath(reportingService, parent);

            reportingService.CreateReport(report.Name, parent, true, report.Definition, null);
        }