Поделиться через


Метод ReportingService2010.SetProperties

Sets one or more properties of a specified item.

Пространство имен:  ReportService2010
Сборка:  ReportService2010 (в ReportService2010.dll)

Синтаксис

'Декларация
<SoapHeaderAttribute("TrustedUserHeaderValue")> _
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction := SoapHeaderDirection.Out)> _
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/SetProperties", RequestNamespace := "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",  _
    ResponseNamespace := "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Sub SetProperties ( _
    ItemPath As String, _
    Properties As Property() _
)
'Применение
Dim instance As ReportingService2010 
Dim ItemPath As String 
Dim Properties As Property()

instance.SetProperties(ItemPath, Properties)
[SoapHeaderAttribute("TrustedUserHeaderValue")]
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/SetProperties", RequestNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    ResponseNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public void SetProperties(
    string ItemPath,
    Property[] Properties
)
[SoapHeaderAttribute(L"TrustedUserHeaderValue")]
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/SetProperties", RequestNamespace = L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    ResponseNamespace = L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    Use = SoapBindingUse::Literal, ParameterStyle = SoapParameterStyle::Wrapped)]
public:
void SetProperties(
    String^ ItemPath, 
    array<Property^>^ Properties
)
[<SoapHeaderAttribute("TrustedUserHeaderValue")>]
[<SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)>]
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/SetProperties", RequestNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    ResponseNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)>]
member SetProperties : 
        ItemPath:string * 
        Properties:Property[] -> unit
public function SetProperties(
    ItemPath : String, 
    Properties : Property[]
)

Параметры

  • ItemPath
    Тип: System.String
    The fully qualified URL of the item including the file name and, in SharePoint mode, the extension.

Замечания

The table below shows header and permissions information on this operation.

SOAP Header Usage

(In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue

Native Mode Required Permissions

Depends on the item type:

SharePoint Mode Required Permissions

EditListItems

You can create new user-defined properties for an item by passing a Property object as a method argument. To remove a property from an item, set the property to an empty value. You cannot remove reserved properties. For a list of reserved item properties, see Свойства элемента сервера отчетов.

If a specified property does not exist when the SetProperties method is called, the property is created and set to the value that you supply. If the property already exists, its value is overwritten. Setting an empty value for a property that does not exist does not affect the item or its properties.

If an error occurs, no properties are set.

Returns rsOperationNotSupportedSharePointMode error when Item=”/”.

Примеры

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

См. также

Справочник

ReportingService2010 Класс

Пространство имен ReportService2010