ReportingService2010.CreateCatalogItem メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
レポートサーバーのデータベースやSharePoint ライブラリに新しいアイテムを追加します。 この方法は Report、 Model、 Dataset、 Component、 Resource、 DataSource のアイテムタイプに適用されます。
public:
ReportService2010::CatalogItem ^ CreateCatalogItem(System::String ^ ItemType, System::String ^ Name, System::String ^ Parent, bool Overwrite, cli::array <System::Byte> ^ Definition, cli::array <ReportService2010::Property ^> ^ Properties, [Runtime::InteropServices::Out] cli::array <ReportService2010::Warning ^> ^ % Warnings);
[System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateCatalogItem", 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 CreateCatalogItem(string ItemType, string Name, string Parent, bool Overwrite, byte[] Definition, ReportService2010.Property[] Properties, out ReportService2010.Warning[] Warnings);
[<System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateCatalogItem", 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.CreateCatalogItem : string * string * string * bool * byte[] * ReportService2010.Property[] * Warning[] -> ReportService2010.CatalogItem
Public Function CreateCatalogItem (ItemType As String, Name As String, Parent As String, Overwrite As Boolean, Definition As Byte(), Properties As Property(), ByRef Warnings As Warning()) As CatalogItem
パラメーター
- ItemType
- String
アイテムの種類。
- Name
- String
新しい項目の名前と、SharePointモードでのファイル拡張子も含まれます。
- Parent
- String
そのアイテムを含む親フォルダの完全修飾URLです。
- Overwrite
- Boolean
指定された場所で同じ名前の既存アイテムを上書きすべきかどうかを示す Boolean 式です。
- Definition
- Byte[]
.rdlレポート定義、レポートモデル定義、またはレポートサーバーに公開するリソースコンテンツ。
返品
新たに作成されたアイテムの 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)
{
ReportingService2010 rs = new ReportingService2010();
rs.Url = "http://<Server Name>" +
"/_vti_bin/ReportServer/ReportService2010.asmx";
rs.Credentials =
System.Net.CredentialCache.DefaultCredentials;
Byte[] definition = null;
Warning[] warnings = null;
string name = "MyReport.rdl";
try
{
FileStream stream = File.OpenRead("MyReport.rdl");
definition = new Byte[stream.Length];
stream.Read(definition, 0, (int)stream.Length);
stream.Close();
}
catch (IOException e)
{
Console.WriteLine(e.Message);
}
try
{
string parent = "http://<Server Name>/Docs/Documents/";
CatalogItem report = rs.CreateCatalogItem("Report", name, parent,
false, definition, null, out warnings);
if (warnings != null)
{
foreach (Warning warning in warnings)
{
Console.WriteLine(warning.Message);
}
}
else
Console.WriteLine("Report: {0} created successfully " +
" with no warnings", name);
}
catch (SoapException e)
{
Console.WriteLine(e.Detail.InnerXml.ToString());
}
}
}
Imports System
Imports System.IO
Imports System.Text
Imports System.Web.Services
Imports System.Web.Services.Protocols
Class Sample
Public Shared Sub Main()
Dim rs As New ReportingService2010()
rs.Url = "http://<Server Name>" + _
"/_vti_bin/ReportServer/ReportService2010.asmx"
rs.Credentials = _
System.Net.CredentialCache.DefaultCredentials
Dim definition As [Byte]() = Nothing
Dim warnings As Warning() = Nothing
Dim name As String = "MyReport.rdl"
Try
Dim stream As FileStream = File.OpenRead("MyReport.rdl")
definition = New [Byte](stream.Length - 1) {}
stream.Read(definition, 0, CInt(stream.Length))
stream.Close()
Catch e As IOException
Console.WriteLine(e.Message)
End Try
Try
Dim parentPath As String = _
"http://<Server Name>/Docs/Documents/"
rs.CreateCatalogItem("Report", name, parentPath, False, _
definition, Nothing, warnings)
If Not (warnings Is Nothing) Then
Dim warning As Warning
For Each warning In warnings
Console.WriteLine(warning.Message)
Next warning
Else
Console.WriteLine("Report: {0} created " + _
"successfully with no warnings", name)
End If
Catch e As SoapException
Console.WriteLine(e.Detail.InnerXml.ToString())
End Try
End Sub
End Class
注釈
以下の表は、この操作のヘッダーおよび権限情報を示しています。
| SOAPヘッダーの使用 | (イン) TrustedUserHeaderValue (アウト) ServerInfoHeaderValue |
| ネイティブモードの必要権限 | アイテムの種類によります: - Report新しいレポートを作成する方法:CreateReportとレポートのデータソース、そしてデータセットの ParentReadPropertiesReadProperties既存レポートの更新: Item(プロパティが含まれている場合Properties)UpdateReportDefinition、ItemUpdateProperties、レポートのデータソースおよびデータセットのUpdatePropertiesUpdateProperties- DataSet新しい共有データセットの作成: ParentとデータセットのデータソースReadPropertiesCreateReport既存の共有データセットの更新: ItemにUpdateReportDefinitionし、Item(Propertiesにプロパティが含まれている場合)UpdateProperties、データセットのデータソースにもUpdateProperties- Resource、 Component:新しいアイテムの作成: CreateResource on Parent既存アイテムの更新: UpdateContent on Itemアイテムプロパティの更新:UpdateContentとUpdateProperties Item- DataSource:新しいデータソースの作成: CreateDatasource on Parent既存データソースの更新: UpdateContent データソースプロパティの更新: UpdateContent AND UpdateProperties - Model: CreateModel |
| SharePointモードの必要権限 | アイテムの種類によります: - Report新しいレポートの作成: Parentと<xref:Microsoft.SharePoint.SPBasePermissions.ViewListItems>に関するデータソースおよびデータセットの<xref:Microsoft.SharePoint.SPBasePermissions.AddListItems>Definition既存レポートの更新: ItemDefinitionで定義されたデータソースやデータセットについて<xref:Microsoft.SharePoint.SPBasePermissions.ViewListItems>、およびItem<xref:Microsoft.SharePoint.SPBasePermissions.ViewListItems>(プロパティが含まれているProperties場合)について<xref:Microsoft.SharePoint.SPBasePermissions.EditListItems>- DataSet新しい共有データセットの作成: Parent<xref:Microsoft.SharePoint.SPBasePermissions.AddListItems>と定義されたデータソース<xref:Microsoft.SharePoint.SPBasePermissions.ViewListItems>Definition既存の共有データセットの更新: Item<xref:Microsoft.SharePoint.SPBasePermissions.EditListItems>と、ItemDefinition<xref:Microsoft.SharePoint.SPBasePermissions.ViewListItems>で定義されたデータソースの<xref:Microsoft.SharePoint.SPBasePermissions.ViewListItems>(プロパティが含まれている場合Properties)- Resource、 DataSource、 Component:新しいアイテムの作成: <xref:Microsoft.SharePoint.SPBasePermissions.AddListItems> on Parent既存のアイテムを更新する: <xref:Microsoft.SharePoint.SPBasePermissions.EditListItems> on Item- Model: <xref:Microsoft.SharePoint.SPBasePermissions.AddListItems> 続けて Parent |
この方法は、サポートされているすべてのアイテムタイプを生成できます。 どのアイテムタイプがサポートされているかを見るには、 ListItemTypes メソッドを使ってください。
Modelアイテムタイプは上書きできません。 したがって、OverwriteパラメータはItemTypeがModelであればFalseなければなりません。 そうでなければ 、rsInvalidParameterCombination 例外がスローされます。
ItemTypeがReportされている場合、XMLデータはレポート定義言語によって定義されます。
ItemTypeがModelされている場合、XMLデータはセマンティックモデル定義言語によって定義されます。
エラーが発生した場合、そのアイテムは作成されません。
レポートサーバーのデータベースやSharePoint ライブラリにアイテムを追加すると、親フォルダのModifiedByおよびModifiedDateプロパティが変更されます。
該当する拡張子(例:.rdl)が項目名から除外されると、 rsFileExtensionRequired エラーが返されます。
Parentパラメータの長さは260文字を超えてはなりません。そうでなければ、エラーコードrsItemLengthExceedでSOAP例外が発生します。
Parentパラメータはnullや空であってはならず、以下の保留文字を含むことはできません:: ? ; @ & = + $ , \ * > < | . "。 フォルダーのフルパス名の項目を区切るためにスラッシュ文字(/)を使うことはできますが、フォルダ名の最後に使うことはできません。