Share via


ReportingService2005.CreateResource 方法

定义

将新的资源添加到报表服务器数据库。

public:
 void CreateResource(System::String ^ Resource, System::String ^ Parent, bool Overwrite, cli::array <System::Byte> ^ Contents, System::String ^ MimeType, cli::array <ReportService2005::Property ^> ^ Properties);
public void CreateResource (string Resource, string Parent, bool Overwrite, byte[] Contents, string MimeType, ReportService2005.Property[] Properties);
member this.CreateResource : string * string * bool * byte[] * string * ReportService2005.Property[] -> unit
Public Sub CreateResource (Resource As String, Parent As String, Overwrite As Boolean, Contents As Byte(), MimeType As String, Properties As Property())

参数

Resource
String

新资源的名称。

Parent
String

要向其中添加新资源的父文件夹的完全限定 URL。

Overwrite
Boolean

一个Boolean表达式,该表达式指定是否覆盖具有相同的名称和路径的现有资源。 默认值为 false

Contents
Byte[]

资源文件的内容。

MimeType
String

资源的多用途 Internet 邮件扩展 (MIME) 类型。 最大大小为 260 个字符。

Properties
Property[]

Property 对象的数组,它定义要为资源设置的属性名和属性值。

注解

下表显示了有关此操作的标头和权限信息。

SOAP 标头 (In) BatchHeaderValue

(Out) ServerInfoHeaderValue
所需的权限 创建新资源: CreateResourceParent

更新现有资源: UpdateContent on Resource

更新资源属性: UpdateContent AND UpdateProperties on Resource

参数的 Parent 长度不能超过 260 个字符;否则,将引发 SOAP 异常,错误代码 为 rsItemLengthExceededed

参数 Parent 不能为 null 或空,也不能包含以下保留字符: : ? ; @ & = + $ , \ * > < | . "。 可以使用 /) (正斜杠字符分隔文件夹的完整路径名称中的项目,但不能在文件夹名称的末尾使用它。

如果发生错误,则不会创建资源。

将资源添加到报表服务器数据库会 ModifiedBy 修改父文件夹的 和 ModifiedDate 属性。

适用于