Export (0) Print
Expand All
Expand Minimize

ReportingService2005.GetReportParameters Method

SQL Server 2005

Returns report parameter properties for a specified report. The GetReportParameters method can also be used to validate parameter values against parameters for a specified report.

Namespace: Microsoft.WSSUX.ReportingServicesWebService.RSManagementService2005
Assembly: ReportService2005 (in reportingservice2005.dll)

[SoapDocumentMethodAttribute("http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetReportParameters", RequestNamespace="http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace="http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)] 
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction=SoapHeaderDirection.Out)] 
public ReportParameter[] GetReportParameters (
	string Report,
	string HistoryID,
	bool ForRendering,
	ParameterValue[] Values,
	DataSourceCredentials[] Credentials
)
/** @attribute SoapDocumentMethodAttribute("http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetReportParameters", RequestNamespace="http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace="http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped) */ 
/** @attribute SoapHeaderAttribute("ServerInfoHeaderValue", Direction=SoapHeaderDirection.Out) */ 
public ReportParameter[] GetReportParameters (
	String Report, 
	String HistoryID, 
	boolean ForRendering, 
	ParameterValue[] Values, 
	DataSourceCredentials[] Credentials
)
SoapDocumentMethodAttribute("http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetReportParameters", RequestNamespace="http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace="http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped) 
SoapHeaderAttribute("ServerInfoHeaderValue", Direction=SoapHeaderDirection.Out) 
public function GetReportParameters (
	Report : String, 
	HistoryID : String, 
	ForRendering : boolean, 
	Values : ParameterValue[], 
	Credentials : DataSourceCredentials[]
) : ReportParameter[]

Parameters

Report

The full path name of the report.

HistoryID

The ID of the report history snapshot. Set the ForRendering parameter to a value of true in order to retrieve parameter properties for a report history snapshot. Set the value to null (Nothing in Visual Basic) if you are retrieving parameters for a report that is not a report history snapshot.

ForRendering

A Boolean expression that indicates how the parameter values are to be used. If set to a value of true, parameter properties that are returned are based on the parameter data that was used during the execution of the report.

Values

The parameter values (ParameterValue objects) that can be validated against the parameters of a report that is managed by the report server.

Credentials

The data source credentials (DataSourceCredentials objects) that can be used to validate query parameters.

Return Value

An array of ReportParameter objects that lists the parameters for the report.

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

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 report 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 report.

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 GetReportParameters method to validate parameters, the ParameterValues parameter is required.

If report parameters do not exist for the given report, an empty ReportParameter 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 GetReportParameters method to retrieve a list of parameter metadata for a report and then displays the name of each parameter:

using System;
using System.Web.Services.Protocols;

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

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

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

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

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

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

Target Platforms

Community Additions

ADD
Show:
© 2014 Microsoft