次の方法で共有


ReportingService2006.CreateFolder(String, String) メソッド

定義

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

public:
 ReportService2006::CatalogItem ^ CreateFolder(System::String ^ Folder, System::String ^ Parent);
public ReportService2006.CatalogItem CreateFolder(string Folder, string Parent);
member this.CreateFolder : string * string -> ReportService2006.CatalogItem
Public Function CreateFolder (Folder As String, Parent As String) As CatalogItem

パラメーター

Folder
String

新しいフォルダーの名前です。

Parent
String

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

戻り値

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

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  

注釈

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

SOAP ヘッダー (In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue
必要なアクセス許可 <xref:Microsoft.SharePoint.SPBasePermissions.AddListItems>

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

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

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

適用対象