ITokenDataExtension.SetUserToken(Byte[]) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
SharePointのユーザートークンを設定します。 この方法はレポートサーバーがSharePointユーザートークンをデータ処理拡張機能に送信するために使われます。
public:
void SetUserToken(cli::array <System::Byte> ^ UserToken);
public void SetUserToken(byte[] UserToken);
abstract member SetUserToken : byte[] -> unit
Public Sub SetUserToken (UserToken As Byte())
パラメーター
- UserToken
- Byte[]
トークンデータを表す byte の配列です。
例
以下のコードは、接続クラスを作成し、SharePointユーザートークンでSharePointデータソースに接続できるIDbConnectionインターフェースを実装する方法を示しています。
using System.Microsoft.ReportingServices.DataProcessing;
using Microsoft.SharePoint;
public class SPConnection : ITokenDataExtension, IDbConnection
{
private SPUserToken token = null;
private SPSite site = null;
...
// Implement the SetUserToken method in ITokenDataExtension
public void SetUserToken(byte[] UserToken)
{
token = new SPUserToken(UserToken);
}
// Implement the Open method in IDbConnection
public void Open()
{
// Connect to a site collection using the token.
// To use a variable for site URL, implement the
// IDbConnection.ConnectionString property accordingly.
site = new SPSite(
"http://contoso/sites/salesdata/thisyear/default.aspx",
token);
...
}
//Implement the other methods and properties in IDbConnection
...
}
Imports System.Microsoft.ReportingServices.DataProcessing
Imports Microsoft.SharePoint
Public Class SPConnection
Implements ITokenDataExtension
Implements IDbConnection
Private token As SPUserToken = Nothing
Private site As SPSite = Nothing
... ' Implement the SetUserToken method in ITokenDataExtension
Public Sub SetUserToken(ByVal UserToken As Byte())
token = New SPUserToken(UserToken)
End Sub
' Implement the Open method in IDbConnection
Public Sub Open()
' Connect to a site collection using the token.
' To use a variable for site URL, implement the
' IDbConnection.ConnectionString property accordingly.
site = New SPSite(_
"http://contoso/sites/salesdata/thisyear/default.aspx",_
token)
End Sub
'Implement the other methods and properties in IDbConnection
...
End Class
注釈
ユーザートークンはほとんどの場合、ログインしたユーザーです。 サブスクリプション配信の場合、これはサブスクリプション作成者のトークンです。 レポートサーバーがユーザートークンを取得できない場合、無人実行アカウントのSharePointトークンを作成します。 詳細については、「Configure the Unattended Execution Account (SSRS Configuration Manager)」をご覧ください。