ReportingService2010.CreateFolder メソッド

レポート サーバー データベースまたは SharePoint ライブラリにフォルダーを追加します。

名前空間:  ReportService2010
アセンブリ:  ReportService2010 (ReportService2010.dll)

構文

'宣言
<SoapHeaderAttribute("TrustedUserHeaderValue")> _
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateFolder", RequestNamespace := "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",  _
    ResponseNamespace := "https://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)
[SoapHeaderAttribute("TrustedUserHeaderValue")]
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateFolder", RequestNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    ResponseNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
public CatalogItem CreateFolder(
    string Folder,
    string Parent,
    Property[] Properties
)
[SoapHeaderAttribute(L"TrustedUserHeaderValue")]
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateFolder", RequestNamespace = L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    ResponseNamespace = L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    Use = SoapBindingUse::Literal, ParameterStyle = SoapParameterStyle::Wrapped)]
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
public:
CatalogItem^ CreateFolder(
    String^ Folder, 
    String^ Parent, 
    array<Property^>^ Properties
)
[<SoapHeaderAttribute("TrustedUserHeaderValue")>]
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateFolder", RequestNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    ResponseNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)>]
[<SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)>]
member CreateFolder : 
        Folder:string * 
        Parent:string * 
        Properties:Property[] -> CatalogItem
public function CreateFolder(
    Folder : String, 
    Parent : String, 
    Properties : Property[]
) : CatalogItem

パラメーター

  • Folder
    型: System.String
    新しいフォルダーの名前です。
  • Parent
    型: System.String
    新しいフォルダーを追加する親フォルダーの完全なパス名です。
  • Properties
    型: array<ReportService2010.Property[]
    フォルダーに設定するプロパティの名前と値を定義する Property オブジェクトの配列です。

戻り値

型: ReportService2010.CatalogItem

説明

次の表に、この操作に関連するヘッダーおよび権限の情報を示します。

SOAP ヘッダーの使用方法

(In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue

ネイティブ モードで必要な権限

CreateFolder

SharePoint モードで必要な権限

AddListItems

新しいフォルダーの完全なパス名は、260 文字以内でなければなりません。これを超えると、エラー コード rsItemLengthExceeded の SOAP 例外がスローされます。

フォルダー名は 128 文字未満にする必要があります。 この名前には NULL や空の文字列は指定できません。また、予約文字 : ? ; @ & = + $ , \ * > < | ." を含めることもできません。 . スラッシュ (/) は、フォルダーの完全なパス名内の各項目を区切るために使用することはできますが、フォルダー名の末尾には使用できません。

個人用レポートが有効な場合、レポート サーバー データベースのルート フォルダーに "個人用レポート" という名前のフォルダーを作成しようとすると、エラー コード rsItemAlreadyExists の SOAP 例外がスローされます。

レポート サーバー データベースにフォルダーを追加すると、親フォルダーの ModifiedBy プロパティと ModifiedDate プロパティが変更されます。

使用例

このコード例をコンパイルするには、Reporting Services の WSDL を参照し、特定の名前空間をインポートする必要があります。 詳細については、「Compiling and Running Code Examples」を参照してください。 次のコード例では、CreateFolder メソッドを使用して、レポート サーバー データベースにフォルダーを作成します。

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"

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

      Catch e As SoapException
         Console.WriteLine(e.Detail.InnerXml)
      End Try
   End Sub 'Main
End Class 'Sample
using System;
using System.Web.Services.Protocols;

class Sample
{
   public static void Main()
   {
      ReportingService rs = new ReportingService2010();
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

      // Create a custom property for the folder.
      Property newProp = new Property();
      newProp.Name = "Department";
      newProp.Value = "Finance";
      Property[] props = new Property[1];
      props[0] = newProp;

      string folderName = "Budget";

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

      catch(SoapException e)
      {
         Console.WriteLine(e.Detail.InnerXml);
      }
   }
}

関連項目

参照

ReportingService2010 クラス

ReportService2010 名前空間