Skip to main content

XtraReport.ParametersRequestBeforeShow Event

Occurs before the Parameters panel is displayed in the Print Preview.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v24.1.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

public event EventHandler<ParametersRequestEventArgs> ParametersRequestBeforeShow

Event Data

The ParametersRequestBeforeShow event's data class is ParametersRequestEventArgs. The following properties provide information specific to this event:

Property Description
ParametersInformation Provides access to information about the requested parameters.

Remarks

Handle the ParametersRequestBeforeShow event in the following cases:

  1. To modify parameter properties (for example, initialize default values) before the parameter is displayed in the Parameters panel.
  2. To replace a parameter editor with a custom editor (WinForms only).

The ParametersRequestEventArgs.ParametersInformation collection stores information about all report parameters. Each element of this collection is a ParameterInfo object. Use the object’s Parameter property to access a parameter and its properties. Use the object’s Editor property to access and modify a parameter’s default editor. Refer to the following topic for more information: Implement a Custom Parameter Editor in WinForms Applications.

Note

The ParametersRequestBeforeShow event is not raised for subreports. You can handle this event for a main report and use the ParametersRequestEventArgs class to access the subreports’ parameters in the event handler.

Example

The following code sample demonstrates how to specify a parameter’s default value in a ParametersRequestBeforeShow event handler:

private void XtraReport1_ParametersRequestBeforeShow(object sender, DevExpress.XtraReports.Parameters.ParametersRequestEventArgs e) {
    foreach (var paramInfo in e.ParametersInformation) {
        if (paramInfo.Parameter.Name == "company") {
            paramInfo.Parameter.Value = "ALFKI";
            break;
        }
    }
}
See Also