xtrareports-js-devexpress-dot-reporting-dot-viewer-859aeb6e.md
A class that triggers events for the Standalone Report Parameters Panel and serves as the sender in callback functions.
export class JSReportParametersPanel extends JSReportViewerBase<DevExpress.Reporting.Viewer.Internal.PreviewDisposableModelBase>
[constructor<T>(_previewModel)](/XtraReports/js-DevExpress.Reporting.Viewer.JSReportViewerBase-1#js_devexpress_reporting_viewer_jsreportviewerbase_1_constructor 1 previewmodel_)
JSReportViewerBase<T> JSReportParametersPanel
Serializes parameter information from the Standalone Report Parameters Panel to a JSON string.
SerializeParametersState(): string
| Type | Description |
|---|---|
| string |
A string in JSON format that contains report parameter information.
|
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:
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).