次の方法で共有


CreateFolder メソッド

レポート サーバー データベースにフォルダーを追加します。

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

構文

'宣言
<SoapHeaderAttribute("BatchHeaderValue")> _
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction := SoapHeaderDirection.Out)> _
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/CreateFolder", RequestNamespace := "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",  _
    ResponseNamespace := "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Sub CreateFolder ( _
    Folder As String, _
    Parent As String, _
    Properties As Property() _
)
'使用
Dim instance As ReportingService2005
Dim Folder As String
Dim Parent As String
Dim Properties As Property()

instance.CreateFolder(Folder, Parent, _
    Properties)
[SoapHeaderAttribute("BatchHeaderValue")]
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/CreateFolder", RequestNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
    ResponseNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public void CreateFolder(
    string Folder,
    string Parent,
    Property[] Properties
)
[SoapHeaderAttribute(L"BatchHeaderValue")]
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/CreateFolder", RequestNamespace = L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
    ResponseNamespace = L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
    Use = SoapBindingUse::Literal, ParameterStyle = SoapParameterStyle::Wrapped)]
public:
void CreateFolder(
    String^ Folder, 
    String^ Parent, 
    array<Property^>^ Properties
)
[<SoapHeaderAttribute("BatchHeaderValue")>]
[<SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)>]
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/CreateFolder", RequestNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
    ResponseNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)>]
member CreateFolder : 
        Folder:string * 
        Parent:string * 
        Properties:Property[] -> unit 
public function CreateFolder(
    Folder : String, 
    Parent : String, 
    Properties : Property[]
)

パラメーター

  • Parent
    型: System. . :: . .String
    新しいフォルダーを追加する親フォルダーの完全なパス名です。

説明

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

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

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

レポート サーバー データベースにフォルダーを追加すると、親フォルダーの 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 ReportingService2005()
      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 ReportingService2005();
      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);
      }
   }
}