GetReportParameters-Methode
Gibt Berichtsparametereigenschaften für einen angegebenen Bericht zurück. Die GetReportParameters-Methode kann außerdem dazu verwendet werden, Parameterwerte anhand von Parametern für einen angegebenen Bericht zu validieren.
Namespace: ReportService2005
Assembly: ReportService2005 (in ReportService2005.dll)
Syntax
'Declaration
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction := SoapHeaderDirection.Out)> _
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetReportParameters", RequestNamespace := "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", _
ResponseNamespace := "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetReportParameters ( _
Report As String, _
HistoryID As String, _
ForRendering As Boolean, _
Values As ParameterValue(), _
Credentials As DataSourceCredentials() _
) As ReportParameter()
'Usage
Dim instance As ReportingService2005
Dim Report As String
Dim HistoryID As String
Dim ForRendering As Boolean
Dim Values As ParameterValue()
Dim Credentials As DataSourceCredentials()
Dim returnValue As ReportParameter()
returnValue = instance.GetReportParameters(Report, _
HistoryID, ForRendering, Values, _
Credentials)
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetReportParameters", RequestNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",
ResponseNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public ReportParameter[] GetReportParameters(
string Report,
string HistoryID,
bool ForRendering,
ParameterValue[] Values,
DataSourceCredentials[] Credentials
)
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetReportParameters", RequestNamespace = L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",
ResponseNamespace = L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",
Use = SoapBindingUse::Literal, ParameterStyle = SoapParameterStyle::Wrapped)]
public:
array<ReportParameter^>^ GetReportParameters(
String^ Report,
String^ HistoryID,
bool ForRendering,
array<ParameterValue^>^ Values,
array<DataSourceCredentials^>^ Credentials
)
[<SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)>]
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetReportParameters", RequestNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",
ResponseNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)>]
member GetReportParameters :
Report:string *
HistoryID:string *
ForRendering:bool *
Values:ParameterValue[] *
Credentials:DataSourceCredentials[] -> ReportParameter[]
public function GetReportParameters(
Report : String,
HistoryID : String,
ForRendering : boolean,
Values : ParameterValue[],
Credentials : DataSourceCredentials[]
) : ReportParameter[]
Parameter
- Report
Typ: System. . :: . .String
Der vollständige Pfadname des Berichts.
- HistoryID
Typ: System. . :: . .String
Die ID der Berichtsverlaufs-Momentaufnahme. Legen Sie den ForRendering-Parameter auf den Wert true fest, um Parametereigenschaften für eine Berichtsverlaufs-Momentaufnahme abzurufen. Legen Sie den Wert auf nullNothingnullptrunitein NULL-Verweis (Nothing in Visual Basic) (Nothing in Visual Basic) fest, wenn Sie Parameter für einen Bericht abrufen, der keine Berichtsverlaufs-Momentaufnahme ist.
- ForRendering
Typ: System. . :: . .Boolean
Ein Boolean-Ausdruck, der angibt, wie die Parameterwerte verwendet werden sollen. Wenn true festgelegt wurde, basieren die zurückgegebenen Parametereigenschaften auf den Parameterdaten, die während der Ausführung des Berichts verwendet wurden.
- Values
Typ: array<ReportService2005. . :: . .ParameterValue> [] () [] []
Die Parameterwerte (ParameterValue-Objekte), die für die Parameter eines Berichts, der vom Berichtsserver verwaltet wird, validiert werden können.
- Credentials
Typ: array<ReportService2005. . :: . .DataSourceCredentials> [] () [] []
Die Anmeldeinformationen für die Datenquelle (DataSourceCredentials-Objekte), mit denen Abfrageparameter validiert werden können.
Rückgabewert
Typ: array<ReportService2005. . :: . .ReportParameter> [] () [] []
Ein Array von ReportParameter-Objekten, das die Parameter für den Bericht aufführt.
Hinweise
The table below shows header and permissions information on this operation.
SOAP Headers |
(Out) ServerInfoHeaderValue |
Required Permissions |
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 Values parameter is required.
If report parameters do not exist for the given report, an empty ReportParameter array is returned.
Beispiele
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:
Imports System
Imports System.Web.Services.Protocols
Class Sample
Public Shared Sub Main()
Dim rs As New ReportingService2005()
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 ReportParameter() = Nothing
Try
parameters = rs.GetReportParameters(report, historyID, forRendering, values, credentials)
If Not (parameters Is Nothing) Then
Dim rp As ReportParameter
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()
{
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());
}
}
}