EaxMdService.setDataSourceDestination

Syntax

setDataSourceDestination(analyzer: PP.Exp.EaxAnalyzer, destinationData: Object, callback: PP.Delegate);

Parameters

analyzer. Express report instance.

destinationData. JSON object that contains metadata of the layout available for the source.

callback. Handler that handles end of layout option setting.

Description

The setDataSourceDestination method sets data source display variant.

Example

Executing the example requires that the HTML page contains the ExpressBox component named expressBox (see Example of Creating the ExpressBox Component). Selection of source layout option must be available in the data source parameters settings:

Set the Full Data with Validation display option:

// Get a service used to work with express report
var eaxMdService = expressBox.getService();
// Get express report document
var eaxAnalyzer = expressBox.getSource();
// Get data source parameters panel
var dataSourceParamsPanel = expressBox.getPropertyBarView().getDataSourceParamsPanel();
// Expand and display the Data Sources Parameters tab
dataSourceParamsPanel.setDestsSectionVisible(True);
dataSourceParamsPanel.expand();
dataSourceParamsPanel.show();
// Determine metadata
var destinationData = {
    CubeKey: 4,
    CubeId: "FULL",
    DestMeta: {
        id: "FULL_VALIDATION",
        isDefault: False,
        k: 5,
        n: "Full data with the Time Series Database validations",
        vis: True
    }
};
// Determine callback function arguments
var cubeDestArgs = new PP.Mb.Ui.PropertyChangedEventArgs({
    PropertyName: PP.Exp.Ui.ControlType.CubeDest,
    Metadata: destinationData,
    TypeUpdateData: [PP.Exp.Ui.ViewTypeUpdate.DataView, PP.Exp.Ui.ViewTypeUpdate.Ribbon, PP.Exp.Ui.ViewTypeUpdate.PropertyBar]
});
// Determine callback function
var onSetDataSourceDestination = function (sender, args) {
    expressBox.getDataView().DocDataChanged.fire(this, args);
    expressBox.getPropertyBarView().refreshAll();
}
// Set a new display option for data source
eaxMdService.setDataSourceDestination(eaxAnalyzer, destinationData, PP.Delegate(onSetDataSourceDestination, this, cubeDestArgs));

After executing the example the Full Data with Validation option is set as the data source layout option.

See also:

EaxMdService