private void InitializeDeploy() { this.Extension = this.GetValueFromConfig("appSettings", "Extension"); this.ServerName = this.GetValueFromConfig("appSettings", "ServerName"); this.DatasourceLocation = this.GetValueFromConfig("appSettings", "DataSourceLocation"); this.Parent = this.GetValueFromConfig("appSettings", "Parent"); this.Folder = this.GetValueFromConfig("appSettings", "Folder"); // Set security credentials for web service client authorization. ReportingService.Credentials = System.Net.CredentialCache.DefaultCredentials; // Create report folder to drop report in. if (this.Folder.Length > 0 && this.Parent.Length > 0) { // Create folder if not exists. if (this.CheckExist(ItemTypeEnum.Folder, this.Parent, this.Folder) == false) { ReportingService.CreateFolder(this.Folder, this.Parent, null); } } else { // Log the error. } this.GetReportsToDeploy("ReportDetails"); this.Deploy(); }
/// <summary> /// Creates Folder in Reporting Services. /// </summary> /// <param name="folderXMLFilePath">XML file path holds folder information.</param> private static void CreateFolders(string folderXMLFilePath) { ReportingService reportingServicesClient = new ReportingService(); reportingServicesClient.Credentials = System.Net.CredentialCache.DefaultCredentials; XDocument xmlDoc = XDocument.Load(folderXMLFilePath); try { var result = from c in xmlDoc.Descendants("Folder") select new { name = (string)c.Element("Name").Value, parentFolder = (string)c.Element("ParentFolder").Value }; foreach (var row in result) { reportingServicesClient.CreateFolder(row.name, row.parentFolder, null); Logging.Log(string.Format("Folder {0} created successfully", row.name)); } } catch (Exception er) { Logging.Log(er.Message); } }
/// <summary> /// Adds a folder to the report server database. /// </summary> /// <param name="host">The IProxyFactory that the algorithm or 'visitor' is executed on.</param> /// <param name="param[0]">The name of the server that has Reporting Service.</param> /// <param name="param[1]">The virtual directory in the server.</param> /// <param name="param[2]">The full path name of the parent folder to which to add /// the new folder. </param> /// <param name="param[3]">The name of the new folder. </param> /// <param name="param[4]">The value of a property for a folder.</param> /// <returns>True for successful; False for otherwise</returns> public object Execute(IProxyFactory host, params object[] param) { string server = (string)param[0]; string virtualRoot = (string)param[1]; string parentPath = (string)param[2]; string folderName = (string)param[3]; string folderDescription = (string)param[4]; ReportingService rs = host.Proxy(server, virtualRoot); Property setProp = new Property(); setProp.Name = "Description"; setProp.Value = folderDescription; Property[] props = new Property[1]; props[0] = setProp; rs.CreateFolder(folderName, parentPath, props); return(true); }
public void CreateFolder(string folder, string parent, string properties) { webserviceProxy.CreateFolder(folder, parent, null); }
public void CreateFolder(string Folder, string Parent) { _proxy.CreateFolder(Folder, Parent, null); }