The requested page is not available for the requested platform. You are viewing the content for Default platform.

PreviewParametersViewModel Class

Provides information about the report parameters' client-side model.

Declaration

class PreviewParametersViewModel extends Analytics.Utils.Disposable

Properties

submit Property

Initiates passing parameter values and generating the report document.

Declaration

submit: () => void

Property Value

Type Description
() => void

An action that submits parameter values

Remarks

The following example shows a custom submit function implementation to hide the Parameters panel automatically after submitting parameter values.

function WebDocumentViewerInit(s, e) {
    var parametersModel = s.GetParametersModel();
    if (!parametersModel) { return; }
    var doSubmit = parametersModel.submit;
    parametersModel.submit = function () {
        try {
            return doSubmit();
        } finally {
            s.GetPreviewModel().tabPanel.collapsed(true);
        }
    };
}

tabInfo Property

Provides information about the tab for specifying parameter values.

Declaration

tabInfo: DevExpress.Analytics.Utils.TabInfo

Property Value

Type Description
TabInfo

An object that provides information about the Parameters tab.

Methods

serializeParameters Method

Serializes report parameters before passing them to the server.

Declaration

serializeParameters(): Array<IKeyValuePair<any>>

Returns

Type Description
Array<IKeyValuePair<any>>

An array with keys and values that specify parameter names and values, respectively.

Remarks

The serializeParameters function serializes report parameters before passing them to the server. If you need to change parameter values, register a custom function as demonstrated below.

function WebDocumentViewerInit(s, e) {
    var parametersModel = s.GetParametersModel();
    if (!parametersModel) { return; }
    var serializeParametersOriginal = parametersModel.serializeParameters;
    parametersModel.serializeParameters = function () {
        var serializedParameters = serializeParametersOriginal.apply(parametersModel);
        var reportParameter = serializedParameters.filter(function (p) { return p.Key === "MyParameterName" })[0];
        if (reportParameter) {
            reportParameter.Value = "my custom parameter value";
        }
        return serializedParameters;
    }
}