Reporting - Parameter Enhancements (v19.2)

Reporting Team Blog
27 November 2019

Thanks to your great feedback, we’ve made some important changes to our .NET Reporting platform in this release cycle. In this post, we’ll describe new parameter-related functionality and associated user experience enhancements.

Define Parameter Values via Expression Binding

You can now define the default parameter value via an Expression Binding. Right-click the square icon () to the right of the Parameter.Value editor in the Properties Panel to open the Expression Editor:

Parameter - How to define expression

As you’ll see, we now give you the ability to use static values (like constants) and allow you to work with these values using various expression functions. The expression evaluates before the Parameter Panel renders, so you can’t use report or parameter data source fields and have no access to the other parameter values.

For instance, you can set the default a parameter value to the current date using the Today() function:

Parameter - Expression Tooltip
Note: You can only specify an expression for parameters whose MultiValue property is disabled.

We will extend this functionality in a future release and give you the ability to select all values for a lookup parameter using an expression function.

Please help us improve parameter support by answering the following survey question:

Date Range Parameter

Most reports need to filter information based on date range. To help address this requirement more effectively, we’ve introduced a Date Range parameter type across all supported platforms. You can now create a single range parameter that renders a single editor with a list of predefined ranges in the Parameters Panel.

Note: The Parameter.LookUpSettings property has been renamed to ValueSourceSettings. For more information on this change, please refer to this document: Report Parameters - The LookUpSettings property is hidden

To create a date range parameter, you must:

  • Add a new Date parameter.
  • Set the parameter’s Value Source property to the Range Parameter’s value:
Parameter - Specify Range Settings
  • Expand the Value Source property to define Start and End parameter values using the Value property editors:

Parameter - Provide Start and End Values

Note: You can define the start and end parameter values using an expression binding.

You might notice that the parameter has changed its icon in the Field List to indicate a range. Moreover, the parameter node is expandable and contains two child parameters: Start and End.

Range Parameter - Field List

You can use these parameters to display the date range in a report’s label using the following expression:

FormatString('{0:d} - {1:d}', ?dateRangeParameter_Start, ?dateRangeParameter_End)

Filtering Specifics

The parent parameter visually and logically combines its internal Start and End parameters in the field list: use these internal parameters to filter report data. For example, you can use them when setting the value of the XtraReport.FilterString property:

Filter String Editor - How to Set Up the FilterString

You can also edit a data source query and associate report parameters with query parameters:

Filter String Editor - How to Set Up the FilterString for a Query

In both instances, once you switch to the print preview, you’ll see the date range parameter editor in the parameters panel:

Parameters Panel - Range Parameter Editor

Note that the End parameter’s value uses 12:00AM or midnight for its time value. For instance, if a user selects October 15, 2019, the underlying DateTime value is October 15 2019 12:00:00 AM. Use the GetDate() function in the Filter String editor if you need to include data for the report:

GetDate([PurchaseDate]) Between(?dateRangeParameter_Start, ?dateRangeParameter_End)

Custom Ranges in the Parameter Editor

We’ve made it easier for you to customize the predefined range list. The RangeParameterEditorOptions static class provides a RegisterDateRange method that you can use to add your own date ranges. For instance, call this method at app startup to add the “Last 2 Month” range:

RangeParameterEditorOptions.RegisterDateRange(
    "Last 2 Month",
    () => DateTime.Today.AddDays(-DateTime.Today.Day + 1).AddMonths(-2),
    () => DateTime.Today.AddDays(-DateTime.Today.Day)
);

Use the RangeParameterEditorOptions.PredefinedDateRanges collection to access and modify the predefined range.

Your Feedback Matters

We have plans to extend the list of supported range parameter types and we would like to hear your thoughts on this. Please cast your vote below to help us refine our plans.

Parameters Panel – Reset Button Behavior

We heard you loud and clear about “Reset” button behavior and decided to change it based on your feedback. A “Reset” button click now reverts parameter values back to their defaults, instead of previously submitted values.

See the breaking change that describes this change and describes a way to revert to the previous behavior: WinForms/WPF End-User Print Preview - The Parameters panel’s Reset button has changed its behavior.

Closing

All these enhancements are based on feedback. Please let us know if you have any concerns about the new functionality described herein. We would also like to hear about any parameter-related scenarios that require custom code (to continue our enhancements in this area).

Riyas Kari
Riyas Kari

great , can you provide a capability to  link one report to another through report properties and pass the master report parameted to the linked report.

All other reporting tool like  Grapecity have this feature , so if you provide this capability it's very helpfull.

27 November, 2019
Dmitry Tok (DevExpress Support)
Dmitry Tok (DevExpress Support)
Hi Riyas,

Thank you for your feedback. I'm interested in your requirements and the details of this scenario. I exported your comment into the How to link two reports and pass parameters from a master to a linked one ticket and invite you to discuss the details there.

27 November, 2019
Anurag Mahato
Anurag Mahato
Parameter expression can be used in Dashboard ?
27 November, 2019
Andrey (DevExpress)
Andrey (DevExpress)

@Anurag Mahato

DevExpress Dashboard does not support Expression Binding in v19.2.
If you have a specific use case, please contact us in our Support Center: https://devexpress.com/ask
. We will discuss available options with you there.

28 November, 2019
Tobias Johansson
Tobias Johansson
I would like to be able to send a parameter of type List<T>.
28 November, 2019
Dmitry Tok (DevExpress Support)
Dmitry Tok (DevExpress Support)

@Tobias,

I see two possible ways to achieve this goal:

1. You need to set the Parameter.Type to this custom type, enable its MultiValue, property and then pass that List<T> to its Value. This example might help as well. 

2. Create a lookup parameter and bind its data source to this collection using ObjectDataSource.

Please submit a support center ticket and describe the scenario if these approaches do not help.



29 November, 2019
Black Star
Black Star

Hello

Is possible to show parameters panel as custom dialog before the preview window;

29 November, 2019
Dmitry Tok (DevExpress Support)
Dmitry Tok (DevExpress Support)

@Black Star,

I believe yes. We would also need to know what platform you're using and the depth of customization you expect to implement to provide you with recommendations. Reach out to our support team for technical assistance with this task!

29 November, 2019

Please login or register to post comments.