EaxMdService.setSourceFromFile

Syntax

setSourceFromFile(report: PP.Exp.EaxDocument, callback: PP.Delegate);

Parameters

report. Express report document.

callback. Callback function.

Description

The setSourceFromFile method shows a dialog box for opening express report from file.

Example

Executing the example requires that the HTML page contains the ExpressBox component named expressBox (see Example of Creating the ExpressBox Component). Show a dialog box for opening a report from file:

// Get a service used to work with express report
var eaxMdService = expressBox.getService();
// Get express report document
var eaxAnalyzer = expressBox.getSource();
// Determine arguments for callback function
var args = new PP.Mb.Ui.PropertyChangedEventArgs({   
    PropertyName: PP.Exp.Ui.ControlType.DataSources,
    Metadata: "Report", // Open express report
    TypeUpdateData: [PP.Exp.Ui.ViewTypeUpdate.PropertyBar, PP.Exp.Ui.ViewTypeUpdate.DataView]
});
// Determine callback function
var onPanelChanged = function (n, t) {        
    var chartView = expressBox.getDataView().getChartView();    
    t ? (chartView.DataChanged.fire(chartView, t.Args), t.Args.fireCallback(n, t)) : chartView.DataChanged.fire(chartView, t);
};
// Display dialog for loading report from file
eaxMbService.setSourceFromFile(eaxAnalyzer, PP.Delegate(this.onPanelChanged, eaxMdService, args));

After executing the example a dialog box for opening a report from file opens:

See also:

EaxMdService