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


Метод GetItemParameters

Возвращает свойства параметра для указанного элемента. Этот метод также можно использовать для проверки значений параметров указанного элемента.

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

Синтаксис

'Декларация
<SoapHeaderAttribute("TrustedUserHeaderValue")> _
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction := SoapHeaderDirection.Out)> _
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/GetItemParameters", 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 Function GetItemParameters ( _
    ItemPath As String, _
    HistoryID As String, _
    ForRendering As Boolean, _
    Values As ParameterValue(), _
    Credentials As DataSourceCredentials() _
) As ItemParameter()
'Применение
Dim instance As ReportingService2010
Dim ItemPath As String
Dim HistoryID As String
Dim ForRendering As Boolean
Dim Values As ParameterValue()
Dim Credentials As DataSourceCredentials()
Dim returnValue As ItemParameter()

returnValue = instance.GetItemParameters(ItemPath, _
    HistoryID, ForRendering, Values, _
    Credentials)
[SoapHeaderAttribute("TrustedUserHeaderValue")]
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/GetItemParameters", 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 ItemParameter[] GetItemParameters(
    string ItemPath,
    string HistoryID,
    bool ForRendering,
    ParameterValue[] Values,
    DataSourceCredentials[] Credentials
)
[SoapHeaderAttribute(L"TrustedUserHeaderValue")]
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/GetItemParameters", 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:
array<ItemParameter^>^ GetItemParameters(
    String^ ItemPath, 
    String^ HistoryID, 
    bool ForRendering, 
    array<ParameterValue^>^ Values, 
    array<DataSourceCredentials^>^ Credentials
)
[<SoapHeaderAttribute("TrustedUserHeaderValue")>]
[<SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)>]
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/GetItemParameters", 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 GetItemParameters : 
        ItemPath:string * 
        HistoryID:string * 
        ForRendering:bool * 
        Values:ParameterValue[] * 
        Credentials:DataSourceCredentials[] -> ItemParameter[] 
public function GetItemParameters(
    ItemPath : String, 
    HistoryID : String, 
    ForRendering : boolean, 
    Values : ParameterValue[], 
    Credentials : DataSourceCredentials[]
) : ItemParameter[]

Параметры

  • ItemPath
    Тип: System. . :: . .String
    Полный URL-адрес элемента, включая имя файла, а также (в режиме интеграции с SharePoint) расширение.
  • HistoryID
    Тип: System. . :: . .String
    Идентификатор моментального снимка журнала элемента. Устанавливает параметр ForRendering в значение true, чтобы получить свойства параметров для моментального снимка журнала элемента. Чтобы получить параметры для элемента, который не является моментальным снимком журнала элемента, задайте значение NULL (Nothing в Visual Basic).
  • ForRendering
    Тип: System. . :: . .Boolean
    Выражение типа Boolean, которое показывает, как должны использоваться значения параметров. Если параметру задано значение true, то его возвращаемые свойства зависят от данных параметра, которые использовались во время выполнения элемента.
  • Values
    Тип: array<ReportService2010. . :: . .ParameterValue> [] () [] []
    Значения параметров (объекты ParameterValue), которые могут проверяться по параметрам элемента, управляемого сервером отчетов.

Возвращаемое значение

Тип: array<ReportService2010. . :: . .ItemParameter> [] () [] []
Массив объектов ItemParameter, содержащий список параметров для элемента.

Замечания

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

SOAP Header Usage

(In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue

Native Mode Required Permissions

ReadProperties

SharePoint Mode Required Permissions

ViewListItems()()()()

If the execution setting for the item is Snapshot, the parameter metadata that is returned is the data that was used when the item history snapshot was created. If the execution setting for the item is Live, the parameter metadata returned represents the parameter data that is associated with the specified item.

If you provide a value for the HistoryID parameter and set the ForRendering parameter value to true, the parameter metadata returned represents the parameter data that was used when the item history snapshot was created. The value supplied for HistoryID is ignored if ForRendering is set to false.If ForRendering is false, the parameter metadata returned represents the parameter data that is currently associated with the specified item.

If any parameters values are based on a query and you are interested in returning the query-based parameters' valid values list, set ForRendering to true. In addition, for query-based parameters, you must pass in all of the credential information required to return the query parameters.

When using the GetItemParameters method to validate parameters, the Values parameter is required.

If parameters do not exist for the given item, an empty ItemParameter array is returned.

Примеры

To compile this code example, you must reference the Reporting Services WSDL and import certain namespaces. For more information, see Compiling and Running Code Examples. The following code example uses the GetItemParameters method to retrieve a list of parameter metadata for a report and then displays the name of each parameter:

Imports System
Imports System.Web.Services.Protocols

Class Sample
   Public Shared Sub Main()
      Dim rs As New ReportingService2010()
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials

      Dim report As String = "/SampleReports/Employee Sales Summary"
      Dim forRendering As Boolean = False
      Dim historyID As String = Nothing
      Dim values As ParameterValue() = Nothing
      Dim credentials As DataSourceCredentials() = Nothing
      Dim parameters As ItemParameter() = Nothing

      Try
         parameters = rs.GetItemParameters(report, historyID, forRendering, values, credentials)

         If Not (parameters Is Nothing) Then
            Dim rp As ItemParameter
            For Each rp In parameters
               Console.WriteLine("Name: {0}", rp.Name)
            Next rp
         End If

      Catch e As SoapException
         Console.WriteLine(e.Detail.InnerXml.ToString())
      End Try
   End Sub 'Main
End Class 'Sample
using System;
using System.Web.Services.Protocols;

class Sample
{
   public static void Main()
   {
      ReportingService2010 rs = new ReportingService2010();
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

      string report = "/SampleReports/Employee Sales Summary";
      bool forRendering = false;
      string historyID = null;
      ParameterValue[] values = null;
      DataSourceCredentials[] credentials = null;
      ItemParameter[] parameters = null;

      try
      {
         parameters = rs.GetItemParameters(report, historyID, forRendering, values, credentials);

         if (parameters != null)
         {
            foreach (ItemParameter rp in parameters)
            {
               Console.WriteLine("Name: {0}", rp.Name);
            }
         }
      }

      catch (SoapException e)
      {
         Console.WriteLine(e.Detail.InnerXml.ToString()); 
      }
   }
}