Back to Devexpress

JSReportParametersPanel Class

xtrareports-js-devexpress-dot-reporting-dot-viewer-859aeb6e.md

latest3.5 KB
Original Source

JSReportParametersPanel Class

A class that triggers events for the Standalone Report Parameters Panel and serves as the sender in callback functions.

Declaration

ts
export class JSReportParametersPanel extends JSReportViewerBase<DevExpress.Reporting.Viewer.Internal.PreviewDisposableModelBase>

Inherited Members

[constructor<T>(_previewModel)](/XtraReports/js-DevExpress.Reporting.Viewer.JSReportViewerBase-1#js_devexpress_reporting_viewer_jsreportviewerbase_1_constructor 1 previewmodel_)

previewModel

Close

GetParametersModel

GetPreviewModel

OpenReport(reportName)

ResetParameters

dispose

onPropertyChanged(args)

previewExists

Inheritance

JSReportViewerBase<T> JSReportParametersPanel

Methods

SerializeParametersState Method

Serializes parameter information from the Standalone Report Parameters Panel to a JSON string.

Declaration

ts
SerializeParametersState(): string

Returns

TypeDescription
string

A string in JSON format that contains report parameter information.

|

Remarks

Use the SerializeParametersState method to get data for all panel parameters. You can send this data to the server to modify the report.

The following code example is the BeforeRender event handler for the Standalone Report Parameters Panel component:

csharp
function OnBeforeRender(sender, e) {
    const panel = sender.GetParametersModel();
    panel.buttons.push({
        onClick: () => {
            const data = sender.SerializeParametersState();
            $.ajax({
                url: "ExportWithParameters",
                method: 'POST',
                data: { serializedParameters: data, reportUrl: "@Model.ReportInfo.ReportUrl" }
            }).then(result => {
                alert(result.message);
            });
        },
        text: 'Export'
    });
    panel.showButtons = true;
}

For more information, review the following help topic: How to Use Parameter Values from the Standalone Report Parameters Panel (ASP.NET Core App).