共用方式為


SetExecutionCredentials2 方法

Sets the credentials associated with the current report execution.

命名空間:  ReportExecution2005
組件:  ReportExecution2005 (在 ReportExecution2005.dll 中)

語法

'宣告
<SoapHeaderAttribute("ExecutionHeaderValue")> _
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction := SoapHeaderDirection.Out)> _
<SoapHeaderAttribute("TrustedUserHeaderValue")> _
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/SetExecutionCredentials2", 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 SetExecutionCredentials2 ( _
    Credentials As DataSourceCredentials() _
) As ExecutionInfo2
'用途
Dim instance As ReportExecutionService
Dim Credentials As DataSourceCredentials()
Dim returnValue As ExecutionInfo2

returnValue = instance.SetExecutionCredentials2(Credentials)
[SoapHeaderAttribute("ExecutionHeaderValue")]
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
[SoapHeaderAttribute("TrustedUserHeaderValue")]
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/SetExecutionCredentials2", 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 ExecutionInfo2 SetExecutionCredentials2(
    DataSourceCredentials[] Credentials
)
[SoapHeaderAttribute(L"ExecutionHeaderValue")]
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
[SoapHeaderAttribute(L"TrustedUserHeaderValue")]
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/SetExecutionCredentials2", 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:
ExecutionInfo2^ SetExecutionCredentials2(
    array<DataSourceCredentials^>^ Credentials
)
[<SoapHeaderAttribute("ExecutionHeaderValue")>]
[<SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)>]
[<SoapHeaderAttribute("TrustedUserHeaderValue")>]
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/SetExecutionCredentials2", 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 SetExecutionCredentials2 : 
        Credentials:DataSourceCredentials[] -> ExecutionInfo2 
public function SetExecutionCredentials2(
    Credentials : DataSourceCredentials[]
) : ExecutionInfo2

參數

傳回值

型別:ReportExecution2005. . :: . .ExecutionInfo2
An ExecutionInfo2 object containing the new execution.

備註

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

SOAP Header Usage

(In) TrustedUserHeaderValue

(In) ExecutionHeaderValue

(Out) ServerInfoHeaderValue

Native Mode Required Permissions

On the main report and all subreports: ReadProperties AND ExecuteAndView

SharePoint Mode Required Permissions

On the main report and all subreports: ViewListItems()()()()

If a snapshot exists when the credentials are set and AllowQueryExecution is false, the snapshot will be cleared, and any parameters will be reset to their default values.

If there are multiple data sources that prompt for the same report, you need to specify all of the credentials at the same time. If one set of credentials must be changed, you must supply all of the credentials again.

Credentials are only persisted for the lifetime of the execution, after which they must be specified again.