Compartir a través de


del método BIMonitoringServiceApplicationProxy.CreateDataSource

Guarda un objeto de origen de datos como un tipo de contenido en una biblioteca de documentos de SharePoint.

Espacio de nombres:  Microsoft.PerformancePoint.Scorecards
Ensamblado:  Microsoft.PerformancePoint.Scorecards.ServerCommon (en Microsoft.PerformancePoint.Scorecards.ServerCommon.dll)

Sintaxis

'Declaración
Public Function CreateDataSource ( _
    listUrl As String, _
    dataSource As DataSource _
) As DataSource
'Uso
Dim instance As BIMonitoringServiceApplicationProxy
Dim listUrl As String
Dim dataSource As DataSource
Dim returnValue As DataSource

returnValue = instance.CreateDataSource(listUrl, _
    dataSource)
public DataSource CreateDataSource(
    string listUrl,
    DataSource dataSource
)

Parámetros

  • listUrl
    Tipo: System.String

    El servidor dirección URL relativa de la biblioteca de documentos de SharePoint para guardar el objeto. Ejemplo: /BI Center/Data Connections for PerformancePoint.

  • dataSource
    Tipo: Microsoft.PerformancePoint.Scorecards.DataSource

    El objeto origen de datos para crear, que especifica valores para la propiedad requerido Name . Para los orígenes de datos personalizados, dataSource también debe especificar la propiedad SubTypeId y el valor debe coincidir con el atributo subType especificado para el origen de datos personalizado en el web.file para PerformancePoint Services.

Valor devuelto

Tipo: Microsoft.PerformancePoint.Scorecards.DataSource
El nuevo origen de datos.

Implementaciones

IBIMonitoringServiceApplicationProxy.CreateDataSource(String, DataSource)

Comentarios

PerformancePoint Services utiliza las bibliotecas de documentos de SharePoint como repositorio para orígenes de datos.

Ejemplos

En el ejemplo de código siguiente se muestra cómo utilizar un método privado para crear un origen de datos y guardarlo en el repositorio.

Para poder compilar este ejemplo de código, debe hacer lo siguiente:

  • Configurar el entorno de desarrollo y crear un proyecto de biblioteca de clases de C# en Visual Studio. Para obtener información acerca de cómo configurar un entorno de desarrollo, consulte Configurar un entorno de desarrollo general para SharePoint 2013.

  • Agregue los archivos DLL de Microsoft.SharePoint, el Microsoft.PerformancePoint.Scorecards.ServerCommon y el Microsoft.PerformancePoint.Scorecards.Client como referencias al proyecto. Para obtener más información acerca de PerformancePoint Services de archivos DLL, consulte PerformancePoint Services DLLs Used in Development Scenarios.

  • Agregue la siguiente directiva de using a la clase: using Microsoft.PerformancePoint.Scorecards;.

// Create a data source that uses the Adventure Works sample cube, based on the following parameters:
//   - dataSourceName is the name for the data source.
//   - docLibUrl is the server-relative URL of the document library to save the data  
//         source to. Example: "/BI Center/Data Connections for PerformancePoint"
// This method returns the new data source. 
private DataSource CreateDataSource(string dataSourceName, string docLibUrl)
{
    if (String.IsNullOrEmpty(dataSourceName))
        throw new ArgumentException("The name must not be null or empty.");
    if (String.IsNullOrEmpty(docLibUrl))
        throw new ArgumentException("The document library URL must not be null or empty.");

    // Create an ADOMD.NET data source that represents the Adventure Works sample cube.
    DataSource ds = DataSource.CreateNew();
    ds.Name.Text = dataSourceName;
    ds.Description.Text = "Created with the SDK.";
    ds.ServerName = "MyServer";
    ds.DatabaseName = "Adventure Works DW";
    ds.CubeName = "Direct Sales";

    // The SourceName property must match the name of a data source provider registered in
    // the CustomDataSourceProviders section of the PerformancePoint Services web.config file.
    // The default path to the web.config file is 
    // %ProgramFiles%\Microsoft Office Servers\14.0\WebServices\PpsMonitoringServer.

    ds.SourceName = "ADOMD.NET";

    // Call the CreateDataSource method to save the new data source to the specified document library.
    // TODO: Handle exceptions from this call.
    // All interaction with the data source should go through the application server.
    // If this code is running within the application server, call the data store directly, as follows.
    // return SPDataStore.GlobalDataStore.CreateDataSource(docLibUrl, ds);

    // If this code is running on a front-end Web server, call the service application proxy, as follows.
    return BIMonitoringServiceApplicationProxy.Default.CreateDataSource(docLibUrl, ds);
}

Vea también

Referencia

clase BIMonitoringServiceApplicationProxy

Miembros BIMonitoringServiceApplicationProxy

Espacio de nombres Microsoft.PerformancePoint.Scorecards