ReportingService2010.SetProperties(String, Property[]) Méthode

Définition

Définit une ou plusieurs propriétés d'un élément spécifié.

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

Paramètres

ItemPath
String

URL complète de l'élément, y compris le nom du fichier et, en mode SharePoint, l'extension.

Properties
Property[]

Tableau d'objets Property qui définit les propriétés et valeurs à définir pour l'élément.

Attributs

Exemples

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  

Remarques

Le tableau suivant présente les informations relatives aux en-têtes et aux autorisations sur cette opération.

Utilisation de l’en-tête SOAP (In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue
Autorisations requises en mode natif Dépend du type d’élément :

- Folder: UpdateProperties
- Report: UpdateProperties
- Resource: UpdateProperties
- DataSource: UpdateProperties
- Model: UpdateProperties
Autorisations requises en mode SharePoint <xref:Microsoft.SharePoint.SPBasePermissions.EditListItems>

Vous pouvez créer de nouvelles propriétés définies par l’utilisateur pour un élément en passant un Property objet en tant qu’argument de méthode. Pour supprimer une propriété d’un élément, définissez la propriété sur une valeur vide. Vous ne pouvez pas supprimer des propriétés réservées. Pour obtenir la liste des propriétés d’élément réservées, consultez Propriétés de l’élément du serveur de rapports.

Si aucune propriété spécifiée n’existe lorsque la SetProperties méthode est appelée, la propriété est créée et définie sur la valeur que vous fournissez. Si la propriété existe déjà, sa valeur est remplacée. La définition d’une valeur vide pour une propriété qui n’existe pas n’affecte pas l’élément ou ses propriétés.

Si une erreur se produit, aucune propriété n’est définie.

Retourne rsOperationNotSupportedSharePointMode une erreur lorsque Item="/ ».

S’applique à