Export (0) Print
Expand All
Expand Minimize

ReportingService2010.CreateFolder Method

Adds a folder to the report server database or SharePoint library.

Namespace:  ReportService2010
Assembly:  ReportService2010 (in ReportService2010.dll)

<SoapHeaderAttribute("TrustedUserHeaderValue")> _
<SoapDocumentMethodAttribute("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateFolder", RequestNamespace := "http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",  _
	ResponseNamespace := "http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",  _
	Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction := SoapHeaderDirection.Out)> _
Public Function CreateFolder ( _
	Folder As String, _
	Parent As String, _
	Properties As Property() _
) As CatalogItem
Dim instance As ReportingService2010
Dim Folder As String
Dim Parent As String
Dim Properties As Property()
Dim returnValue As CatalogItem

returnValue = instance.CreateFolder(Folder, _
	Parent, Properties)


Type: System.String
The name of the new folder.
Type: System.String
The full path name of the parent folder to which to add the new folder.
Type: ReportService2010.Property()
An array of Property objects that defines the property names and values to set for the folder.

The table below shows header and permissions information on this operation.

SOAP Header Usage

(In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue

Native Mode Required Permissions


SharePoint Mode Required Permissions


The length of the full path name for the new folder cannot exceed 260 characters; otherwise, a SOAP exception is thrown with the error code rsItemLengthExceeded.

Folder names must be less than 128 characters long. The names cannot be null, consist of empty strings, or contain the following reserved characters: : ? ; @ & = + $ , \ * > < | . ". You can use the forward slash character (/) to separate items in the full path name of the folder, but you cannot use it at the end of the folder name.

If My Reports is enabled, a SOAP exception is thrown with the error code rsItemAlreadyExists if you attempt to create a folder named "My Reports" in the root folder of the report server database.

Adding a folder to the report server database modifies the ModifiedBy and ModifiedDate properties of the parent folder.

To compile this code example, you must reference the Reporting Services WSDL and import certain namespaces. For more information, see Compiling and Running Code Examples. The following code example uses the CreateFolder method to create a folder in the report server database:

Imports System
Imports System.Web.Services.Protocols

Class Sample
   Public Shared Sub Main()
      Dim rs As New ReportingService2010()
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials

      ' Create a custom property for the folder.
      Dim newProp As New [Property]()
      newProp.Name = "Department"
      newProp.Value = "Finance"
      Dim props(0) As [Property]
      props(0) = newProp

      Dim folderName As String = "Budget"

         rs.CreateFolder(folderName, "/", props)
         Console.WriteLine("Folder created: {0}", folderName)

      Catch e As SoapException
      End Try
   End Sub 'Main
End Class 'Sample
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft