xtrareports-devexpress-dot-xtrareports-dot-parameters.md
Contains methods that allow you to customize the Parameters panel.
Namespace : DevExpress.XtraReports.Parameters
Assembly : DevExpress.XtraReports.v25.2.dll
NuGet Package : DevExpress.Reporting.Core
public class ParameterPanelFluentBuilder :
ParameterPanelFluentBuilderBase
Public Class ParameterPanelFluentBuilder
Inherits ParameterPanelFluentBuilderBase
The following members return ParameterPanelFluentBuilder objects:
You can unite report parameters into expandable groups, place parameters side-by-side, add separators, and more.
| Default panel | Customized panel |
|---|---|
Use the ParameterPanelFluentBuilder class as follows:
using DevExpress.XtraReports.Parameters;
// ...
ParameterPanelFluentBuilder.Begin(report)
// Customize the panel
.End();
Imports DevExpress.XtraReports.Parameters
' ...
ParameterPanelFluentBuilder.Begin(report). ' Customize the panel
End()
Pass the report instance to the Document Viewer after you finish customization of the Parameters panel for this instance. See the following examples for details on how to complete this task for the WinForms and ASP.NET Core platforms:
View Example: Reporting for WinForms - Customize the Parameters Panel
View Example: Reporting for ASP.NET Core - Customize the Parameters Panel
A customized Parameters panel contains items of the following types:
Parameter itemCustomizes a report parameter.Group itemCreates and customizes a parameter group.Separator itemAdds a separator between groups and parameters.
There are two ways to create a new item:
Call an item’s Begin method, customize the item, and call the item’s End method.
Call an item’s AddItem method and pass a customization action as a parameter.
These ways have the same customization capabilities and differ only in syntax. In the following sections, we describe the second way in detail. For more examples on how to use the first way, refer to the description of the Begin / End methods:
using DevExpress.XtraReports.Parameters;
// ...
using Orientation = DevExpress.XtraReports.Parameters.Orientation;
// ...
ParameterPanelFluentBuilder.Begin(report)
.AddParameterItem(report.Parameters[0], p => p
.WithLabelOrientation(Orientation.Vertical))
.End();
Imports DevExpress.XtraReports.Parameters
' ...
Imports Orientation = DevExpress.XtraReports.Parameters.Orientation
' ...
ParameterPanelFluentBuilder.Begin(report).
AddParameterItem(report.Parameters(0), Function(p) p.
WithLabelOrientation(Orientation.Vertical)).
End()
| orientation = Horizontal (Default) | orientation = Vertical |
|---|---|
Call the AddParameterItem method only for those report parameters that you want to customize. The Parameters panel displays the remaining parameters at the end (with default settings).
Call the AddGroupItem method and implement a customization action. In this action, customize group appearance, add parameters, groups, and separators.
using DevExpress.XtraReports.Parameters;
// ...
ParameterPanelFluentBuilder.Begin(report)
.AddParameterItem(report.Parameters[0])
.AddGroupItem(g => g
.WithTitle("Select a customer")
.AddParameterItem(report.Parameters[1])
.AddParameterItem(report.Parameters[2]))
.End();
Imports DevExpress.XtraReports.Parameters
' ...
ParameterPanelFluentBuilder.Begin(report).
AddParameterItem(report.Parameters(0)).
AddGroupItem(Function(g) g.
WithTitle("Select a customer").
AddParameterItem(report.Parameters(1)).
AddParameterItem(report.Parameters(2))).
End()
| Default panel | Panel with a group |
|---|---|
The example above uses the WithTitle method to specify a group title. You can also use the following methods to configure a group:
WithOrientation(Orientation orientation) - specifies whether group parameters should be located vertically or horizontally.
Call the AddSeparatorItem method to add a separator between parameters or groups.
using DevExpress.XtraReports.Parameters;
// ...
ParameterPanelFluentBuilder.Begin(report)
.AddParameterItem(report.Parameters[0])
.AddSeparatorItem()
.AddParameterItem(report.Parameters[1])
.End();
Imports DevExpress.XtraReports.Parameters
' ...
ParameterPanelFluentBuilder.Begin(report).
AddParameterItem(report.Parameters(0)).
AddSeparatorItem().
AddParameterItem(report.Parameters(1)).
End()
| Default panel | Panel with a separator between parameters |
|---|---|
You can reconfigure items of a customized panel or remove some or all items to discard customization.
The following example removes a parameter and separator from a group and changes the label orientation of another parameter from the same group.
using DevExpress.XtraReports.Parameters;
// ...
using Orientation = DevExpress.XtraReports.Parameters.Orientation;
// ...
ParameterPanelFluentBuilder.Begin(report)
.GetGroupItem(0)
.RemoveParameterItem(report.Parameters[0])
.RemoveSeparatorItem(0)
.GetParameterItem(report.Parameters[1], p1 => p1
.WithLabelOrientation(Orientation.Horizontal))
.End();
Imports DevExpress.XtraReports.Parameters
' ...
Imports Orientation = DevExpress.XtraReports.Parameters.Orientation
' ...
ParameterPanelFluentBuilder.Begin(report).
GetGroupItem(0).
RemoveParameterItem(report.Parameters(0)).
RemoveSeparatorItem(0).
GetParameterItem(report.Parameters(1), Function(p1) p1.
WithLabelOrientation(Orientation.Horizontal)).
End()
| Initial panel | Modified panel |
|---|---|
Refer to the descriptions of the following methods for more information:
using DevExpress.XtraReports.Parameters;
// ...
using Orientation = DevExpress.XtraReports.Parameters.Orientation;
// ...
ParameterPanelFluentBuilder.Begin(report)
.AddGroupItem(g0 => g0
.WithTitle("Select dates")
.AddParameterItem(report.Parameters[0], p0 => p0
.WithLabelOrientation(Orientation.Vertical)))
.AddGroupItem(g1 => g1
.WithTitle("Select a customer")
.WithOrientation(Orientation.Horizontal)
.WithShowExpandButton(true)
.AddParameterItem(report.Parameters[1], p1 => p1
.WithLabelOrientation(Orientation.Vertical))
.AddSeparatorItem()
.AddParameterItem(report.Parameters[2], p2 => p2
.WithLabelOrientation(Orientation.Vertical)))
.End();
Imports DevExpress.XtraReports.Parameters
' ...
Imports Orientation = DevExpress.XtraReports.Parameters.Orientation
' ...
ParameterPanelFluentBuilder.Begin(report).
AddGroupItem(Function(g0) g0.
WithTitle("Select dates").
AddParameterItem(report.Parameters(0), Function(p0) p0.
WithLabelOrientation(Orientation.Vertical))).
AddGroupItem(Function(g1) g1.
WithTitle("Select a customer").
WithOrientation(Orientation.Horizontal).
WithShowExpandButton(True).
AddParameterItem(report.Parameters(1), Function(p1) p1.
WithLabelOrientation(Orientation.Vertical)).
AddSeparatorItem().
AddParameterItem(report.Parameters(2), Function(p2) p2.
WithLabelOrientation(Orientation.Vertical))).
End()
| Default panel | Customized panel |
|---|---|
The following example specifies an expression for a parameter’s Enabled property to enable/disable the parameter’s editor based on a value of another parameter.
using DevExpress.XtraReports.Parameters;
// ...
using DevExpress.XtraReports.Expressions;
// ...
ParameterPanelFluentBuilder.Begin(report)
.AddGroupItem(g0 => g0
.WithTitle("Select dates")
.AddParameterItem(report.Parameters[0]))
.AddGroupItem(g1 => g1
.WithTitle("Select a customer")
.AddParameterItem(report.Parameters[1])
.AddParameterItem(report.Parameters[2]))
.End();
report.Parameters["customer"].ExpressionBindings.Add(
new BasicExpressionBinding() {
PropertyName = "Enabled",
Expression = "!IsNullOrEmpty(?company)",
});
Imports DevExpress.XtraReports.Parameters
' ...
Imports DevExpress.XtraReports.Expressions
' ...
ParameterPanelFluentBuilder.Begin(report).
AddGroupItem(Function(g0) g0.
WithTitle("Select dates").
AddParameterItem(report.Parameters(0))).
AddGroupItem(Function(g1) g1.
WithTitle("Select a customer").
AddParameterItem(report.Parameters(1)).
AddParameterItem(report.Parameters(2))).
End()
report.Parameters("customer").ExpressionBindings.Add(
New BasicExpressionBinding() With {
.PropertyName = "Enabled",
.Expression = "!IsNullOrEmpty(?company)"
})
You can specify the same expression for the parameter’s Visible property to show/hide the parameter’s editor.
Object GroupItemFluentBuilder ParameterPanelFluentBuilderBase ParameterPanelFluentBuilder
See Also