Примечание.
Для доступа к этой странице требуется авторизация. Вы можете попробовать войти или изменить каталоги.
Для доступа к этой странице требуется авторизация. Вы можете попробовать изменить каталоги.
Sets the SharePoint user token. This method is used by the report server to send the SharePoint user token to the data processing extension.
Пространство имен: Microsoft.ReportingServices.DataProcessing
Сборки: Microsoft.ReportingServices.SharePoint.UI.WebParts (в Microsoft.ReportingServices.SharePoint.UI.WebParts.dll)
Microsoft.ReportingServices.Interfaces (в Microsoft.ReportingServices.Interfaces.dll)
Синтаксис
'Декларация
Sub SetUserToken ( _
UserToken As Byte() _
)
'Применение
Dim instance As ITokenDataExtension
Dim UserToken As Byte()
instance.SetUserToken(UserToken)
void SetUserToken(
byte[] UserToken
)
void SetUserToken(
array<unsigned char>^ UserToken
)
abstract SetUserToken :
UserToken:byte[] -> unit
function SetUserToken(
UserToken : byte[]
)
Параметры
- UserToken
Тип: array<System.Byte[]
An array of byte that represents the token data.
Замечания
The user token is almost always the logged-on user. In the case of subscription delivery, this is the token of the subscription creator. If the report server cannot obtain a user token, it creates a SharePoint token of the unattended execution account. For more information, see Настройка учетной записи автоматического выполнения..
Примеры
The following code demonstrates how to create a connection class implement an IDbConnection interface that can connect to a SharePoint data source with a SharePoint user token.
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
См. также
Справочник
Пространство имен Microsoft.ReportingServices.DataProcessing