xtrareports-devexpress-dot-xtrareports-dot-ui-dot-xtrareport-f92982a7.md
Occurs before the Parameters panel is displayed in the Print Preview.
Namespace : DevExpress.XtraReports.UI
Assembly : DevExpress.XtraReports.v25.2.dll
NuGet Package : DevExpress.Reporting.Core
public event EventHandler<ParametersRequestEventArgs> ParametersRequestBeforeShow
Public Event ParametersRequestBeforeShow As EventHandler(Of ParametersRequestEventArgs)
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. |
Handle the ParametersRequestBeforeShow event in the following cases:
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.
The following code sample specifies 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;
}
}
}
Private Sub XtraReport1_ParametersRequestBeforeShow(sender As Object, e As DevExpress.XtraReports.Parameters.ParametersRequestEventArgs) Handles MyBase.ParametersRequestBeforeShow
For Each paramInfo In e.ParametersInformation
If paramInfo.Parameter.Name = "company" Then
paramInfo.Parameter.Value = "ALFKI"
Exit For
End If
Next paramInfo
End Sub
See Also