ReportingService2010.CreateFolder(String, String, Property[]) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
レポートサーバーのデータベースやSharePoint ライブラリにフォルダを追加します。
public:
ReportService2010::CatalogItem ^ CreateFolder(System::String ^ Folder, System::String ^ Parent, cli::array <ReportService2010::Property ^> ^ Properties);
[System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateFolder", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, RequestNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", ResponseNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", Use=System.Web.Services.Description.SoapBindingUse.Literal)]
[System.Web.Services.Protocols.SoapHeader("TrustedUserHeaderValue")]
[System.Web.Services.Protocols.SoapHeader("ServerInfoHeaderValue", Direction=System.Web.Services.Protocols.SoapHeaderDirection.Out)]
public ReportService2010.CatalogItem CreateFolder(string Folder, string Parent, ReportService2010.Property[] Properties);
[<System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateFolder", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, RequestNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", ResponseNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", Use=System.Web.Services.Description.SoapBindingUse.Literal)>]
[<System.Web.Services.Protocols.SoapHeader("TrustedUserHeaderValue")>]
[<System.Web.Services.Protocols.SoapHeader("ServerInfoHeaderValue", Direction=System.Web.Services.Protocols.SoapHeaderDirection.Out)>]
member this.CreateFolder : string * string * ReportService2010.Property[] -> ReportService2010.CatalogItem
Public Function CreateFolder (Folder As String, Parent As String, Properties As Property()) As CatalogItem
パラメーター
- Folder
- String
新しいフォルダの名前。
- Parent
- String
新しいフォルダを追加する親フォルダのフルパス名。
返品
作成されたフォルダ。
- 属性
例
このコード例をコンパイルするには、Reporting Services WSDLを参照し、特定の名前空間をインポートする必要があります。 詳細については 、「コード例のコンパイルと実行」をご覧ください。 以下のコード例は、レポートサーバーデータベース内にフォルダを作成するために 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);
}
}
}
注釈
以下の表は、この操作のヘッダーおよび権限情報を示しています。
| SOAPヘッダーの使用 | (イン) TrustedUserHeaderValue (アウト) ServerInfoHeaderValue |
| ネイティブモードの必要権限 | CreateFolder |
| SharePointモードの必要権限 | <xref:Microsoft.SharePoint.SPBasePermissions.AddListItems> |
新しいフォルダのフルパス名の長さは260文字を超えてはなりません。そうでなければ、エラーコード rsItemLengthExceededを含むSOAP例外がスローされます。
フォルダ名は128文字未満でなければなりません。 名前はnullであってはならず、空文字列で構成されてはいけませんし、以下の予約文字も含めてはいけません:? ;@ & = + $ , \ * >< | ". フォルダーのフルパス名の項目を区切るためにスラッシュ文字(/)を使うことはできますが、フォルダ名の最後に使うことはできません。
My Reportsが有効の場合、レポートサーバーデータベースのルートフォルダに「My Reports」というフォルダを作ろうとすると、エラーコード付きのSOAP例外が rsItemAlreadyExists されます。
レポートサーバーデータベースにフォルダを追加すると、親フォルダの ModifiedBy および ModifiedDate プロパティが変更されます。