IReportParametersSerializer Interface
Defines methods that enable you to deserialize parameters received from the Standalone Report Parameters Panel component and apply parameters to a report instance.
Namespace: DevExpress.XtraReports.Web.ParametersPanel
Assembly: DevExpress.XtraReports.v24.1.Web.dll
NuGet Package: DevExpress.Web.Reporting.Common
Declaration
Remarks
The default implementation of IReportParametersSerializer
is registered at application startup within the AddDevExpressControls
method call. In the controller action, you can get the service from the request services:
public async Task<IActionResult> ExportWithParameters(
[FromServices] IReportParametersSerializer reportParametersSerializer,
[FromServices] IWebHostEnvironment env,
[FromForm] string serializedParameters,
[FromForm] string reportUrl) {
var report = await reportParametersSerializer.ApplyParametersStateAsync(reportUrl,
serializedParameters);
report.ExportToPdf(Path.Combine(env.ContentRootPath,
"Reports", $"{reportUrl}.pdf"));
return Ok(new { message = "Report exported successfully" });
}
Serialized parameters are obtained from the client as a result of the SerializeParametersState method.
Note that one of the IReportParametersSerializer.GetModel
method parameters is a report string identifier (reportUrl), so the application must have the report name resolution service (IReportProvider or ReportStorageWebExtension) implemented and registered at application startup.