次の方法で共有


CreateFolder メソッド

フォルダーを SharePoint ライブラリに追加します。

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

構文

'宣言
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction := SoapHeaderDirection.Out)> _
<SoapHeaderAttribute("TrustedUserHeaderValue")> _
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2006/03/15/reporting/reportingservices/CreateFolder", RequestNamespace := "https://schemas.microsoft.com/sqlserver/2006/03/15/reporting/reportingservices",  _
    ResponseNamespace := "https://schemas.microsoft.com/sqlserver/2006/03/15/reporting/reportingservices",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function CreateFolder ( _
    Folder As String, _
    Parent As String _
) As CatalogItem
'使用
Dim instance As ReportingService2006
Dim Folder As String
Dim Parent As String
Dim returnValue As CatalogItem

returnValue = instance.CreateFolder(Folder, _
    Parent)
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
[SoapHeaderAttribute("TrustedUserHeaderValue")]
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2006/03/15/reporting/reportingservices/CreateFolder", RequestNamespace = "https://schemas.microsoft.com/sqlserver/2006/03/15/reporting/reportingservices", 
    ResponseNamespace = "https://schemas.microsoft.com/sqlserver/2006/03/15/reporting/reportingservices", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public CatalogItem CreateFolder(
    string Folder,
    string Parent
)
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
[SoapHeaderAttribute(L"TrustedUserHeaderValue")]
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/2006/03/15/reporting/reportingservices/CreateFolder", RequestNamespace = L"https://schemas.microsoft.com/sqlserver/2006/03/15/reporting/reportingservices", 
    ResponseNamespace = L"https://schemas.microsoft.com/sqlserver/2006/03/15/reporting/reportingservices", 
    Use = SoapBindingUse::Literal, ParameterStyle = SoapParameterStyle::Wrapped)]
public:
CatalogItem^ CreateFolder(
    String^ Folder, 
    String^ Parent
)
[<SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)>]
[<SoapHeaderAttribute("TrustedUserHeaderValue")>]
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2006/03/15/reporting/reportingservices/CreateFolder", RequestNamespace = "https://schemas.microsoft.com/sqlserver/2006/03/15/reporting/reportingservices", 
    ResponseNamespace = "https://schemas.microsoft.com/sqlserver/2006/03/15/reporting/reportingservices", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)>]
member CreateFolder : 
        Folder:string * 
        Parent:string -> CatalogItem 
public function CreateFolder(
    Folder : String, 
    Parent : String
) : CatalogItem

パラメーター

  • Parent
    型: System. . :: . .String
    新しいフォルダーを格納する親フォルダーまたはサイトの完全修飾 URL です。

戻り値

型: ReportService2006. . :: . .CatalogItem
新しく作成されたフォルダーの CatalogItem オブジェクトです。

説明

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

SOAP ヘッダー

(In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue

必要な権限

AddListItems()()()()

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

フォルダー名は 128 文字未満にする必要があります。この名前には NULL や空の文字列は指定できません。また、予約文字 : ? @ & = + $ , \ * > < | ." も使用できません。

SharePoint ライブラリにフォルダーを追加すると、親フォルダーの ModifiedBy プロパティと ModifiedDate プロパティが変更されます。

使用例

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

class Sample
{
    static void Main(string[] args)
    {
        ReportingService2006 rs = new ReportingService2006();
        rs.Url = "http://<Server Name>" +
            "/_vti_bin/ReportServer/ReportService2006.asmx";
        rs.Credentials = 
            System.Net.CredentialCache.DefaultCredentials;

        string folderName = "Budget";
        string parent = "http://<Server Name>/Docs/Documents/";

        try
        {
            rs.CreateFolder(folderName, parent);
            Console.WriteLine("Folder created: {0}", folderName);
        }
        catch (SoapException e)
        {
            Console.WriteLine(e.Detail.InnerXml);
        }
    }
}
Imports System
Imports System.Web.Services
Imports System.Web.Services.Protocols

Class Sample

    Public Shared Sub Main()

        Dim rs As New ReportingService2006()
        rs.Url = "http://<Server Name>" + _
            "/_vti_bin/ReportServer/ReportService2006.asmx"
        rs.Credentials = _
            System.Net.CredentialCache.DefaultCredentials

        Dim folderName As String = "Budget"
        Dim parentPath As String = _
            "http://<Server Name>/Docs/Documents/"

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

        Catch e As SoapException
            Console.WriteLine(e.Detail.InnerXml)
        End Try

    End Sub

End Class