This example uses the ParameterPanelFluentBuilder class to customize the Document Viewer's Parameters panel as follows:
- Unite report parameters into groups and place parameters side-by-side.
- Place a label and editor vertically for each parameter.
- Add a separator between parameters inside a group.
Default panel | Customized panel |
---|---|
The example also specifies an expression for the Enabled property to enable/disable a parameter's editor based on a value of another parameter.
The following code sample demonstrates how to transform the default panel above to the customized panel:
var report = new TestReport();
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();
report.Parameters["customer"].ExpressionBindings.Add(
new BasicExpressionBinding() {
PropertyName = "Enabled",
Expression = "!IsNullOrEmpty(?company)",
}
);
To customize the Parameters panel in an ASP.NET Core Reporting application, do the following:
- Create an instance of a report whose Parameters panel you want to customize.
- Pass the instance to the ParameterPanelFluentBuilder class Begin method and call customization methods.
- Open the report preview as described in the following topic: Open a Report in ASP.NET Core Application.
(you will be redirected to DevExpress.com to submit your response)