ReportingService2010.SetProperties(String, Property[]) Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Establece una o más propiedades de un elemento especificado.
public:
void SetProperties(System::String ^ ItemPath, cli::array <ReportService2010::Property ^> ^ Properties);
[System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/SetProperties", 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 void SetProperties(string ItemPath, ReportService2010.Property[] Properties);
[<System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/SetProperties", 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.SetProperties : string * ReportService2010.Property[] -> unit
Public Sub SetProperties (ItemPath As String, Properties As Property())
Parámetros
- ItemPath
- String
La URL totalmente cualificada del elemento incluyendo el nombre del archivo y, en modo SharePoint, la extensión.
- Properties
- Property[]
Un array de Property objetos que define las propiedades y valores a establecer para el elemento.
- Atributos
Ejemplos
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;
Property[] props = new Property[1];
Property setProp = new Property();
setProp.Name = "Description";
setProp.Value = "Sales by quarter and product category.";
props[0] = setProp;
string itemPath = "http://<Server Name>/Docs/Documents/" +
"AdventureWorks Sample Reports/Sales Order Detail.rdl";
try
{
rs.SetProperties(itemPath, props);
Console.WriteLine("New description set on item {0}.",
itemPath);
}
catch (SoapException ex)
{
Console.WriteLine(ex.Detail.OuterXml);
}
}
}
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 props(0) As [Property]
Dim setProp As New [Property]()
setProp.Name = "Description"
setProp.Value = "Sales by quarter and product category."
props(0) = setProp
Dim itemPath As String = "http://<Server Name>/Docs/" + _
"Documents/AdventureWorks Sample Reports/" + _
"Sales Order Detail.rdl"
Try
rs.SetProperties(itemPath, props)
Console.WriteLine("New description set on item {0}.", _
itemPath)
Catch ex As SoapException
Console.WriteLine(ex.Detail.OuterXml)
End Try
End Sub
End Class
Comentarios
La siguiente tabla muestra la información sobre cabeceras y permisos sobre esta operación.
| Uso de la cabecera SOAP | (En) TrustedUserHeaderValue (Fuera) ServerInfoHeaderValue |
| Permisos requeridos en modo nativo | Depende del tipo de objeto: - Folder: UpdateProperties- Report: UpdateProperties- Resource: UpdateProperties- DataSource: UpdateProperties- Model: UpdateProperties |
| Permisos requeridos en el modo SharePoint | <xref:Microsoft.SharePoint.SPBasePermissions.EditListItems> |
Puedes crear nuevas propiedades definidas por el usuario para un elemento pasando un Property objeto como argumento de método. Para eliminar una propiedad de un elemento, establece esa propiedad en un valor vacío. No puedes eliminar propiedades reservadas. Para una lista de propiedades de elementos reservadas, consulte Propiedades de Elementos del Servidor de Informes.
Si una propiedad especificada no existe cuando se llama al SetProperties método, la propiedad se crea y se establece al valor que proporcionas. Si la propiedad ya existe, su valor se sobrescribe. Establecer un valor vacío para una propiedad que no existe no afecta al elemento ni a sus propiedades.
Si ocurre un error, no se establecen propiedades.
Devuelve rsOperationNotSupportedSharePointMode el error cuando Item="/".