ReportingService2005.CreateResource(String, String, Boolean, Byte[], String, Property[]) Method


将新的资源添加到报表服务器数据库。Adds a new resource to the report server database.

 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())



新资源的名称。The name of the new resource.


要向其中添加新资源的父文件夹的完全限定 URL。The fully qualified URL of the parent folder to which to add the new resource.


一个Boolean表达式,该表达式指定是否覆盖具有相同的名称和路径的现有资源。A Boolean expression that specifies whether to overwrite an existing resource with the same name and path. 默认值为 falseThe default value is false.


资源文件的内容。The contents of the resource file.


资源的多用途 Internet 邮件扩展 (MIME) 类型。The Multipurpose Internet Mail Extensions (MIME) type of the resource. 最大大小为 260 个字符。The maximum size is 260 characters.


Property 对象的数组,它定义要为资源设置的属性名和属性值。An array of Property objects that defines the property names and values to set for the resource.


下表显示了有关此操作的标头和权限信息。The table below shows header and permissions information on this operation.

SOAP 标头SOAP Headers (In) BatchHeaderValue(In) BatchHeaderValue

(Out) ServerInfoHeaderValue(Out) ServerInfoHeaderValue
所需的权限Required Permissions 创建新资源: CreateResource 打开 ParentCreating a new resource: CreateResource on Parent

更新现有 UpdateContent 资源: ResourceUpdating an existing resource: UpdateContent on Resource

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

参数的长度 Parent 不能超过260个字符; 否则,将引发带有错误代码 RSITEMLENGTHEXCEEDED 的 SOAP 异常。The length of the Parent parameter cannot exceed 260 characters; otherwise, a SOAP exception is thrown with the error code rsItemLengthExceeded.

Parent参数不能为 null 或为空,也不能包含以下保留字符: : ? ; @ & = + $ , \ * > < | . "The Parent parameter cannot be null or empty or contain the following reserved characters: : ? ; @ & = + $ , \ * > < | . ". 您可以使用正斜杠 (/) 来分隔文件夹的完整路径名中的项,但不能在文件夹名称的末尾使用。You can use the forward slash character (/) to separate items in the full path name of the folder, but you cannot use it at the end of the folder name.

如果发生错误,则不会创建资源。If errors occur, the resource is not created.

将资源添加到 Report Server 数据库会修改 ModifiedBy ModifiedDate 父文件夹的和属性。Adding a resource to the report server database modifies the ModifiedBy and ModifiedDate properties of the parent folder.

Applies to