KPI Module Improvements (coming in v2011 vol1)

XAF Team Blog
31 May 2011

In order to simplify the creation of evaluating expressions for the XAF KPI we have implemented a new PropertyEditor - PopupExpressionPropertyEditor.

Let's demonstrate its features in the FeatureCenter demo.

To enable this editor for a property of your object, set PropertyEditorType for the Expression property of the KpiDefinition class via Model Editor.

ModelEditor

Then close Model Editor, navigate to KPI –> Definition, and open the "Sales" object:

KpiDefinition

Click the ellipsis button on the right side of the "Expression" Property Editor control. It will invoke the Expression Editor form, where you can easily compose expressions of any complexity. In FeatureCenter, we use a simple expression - let's select "Aggregate operations" and choose the "Sum()" operator.

ExpressionEditor - Aggregate operations

Then we select "Fields" and choose the "Freight" field.

ExpressionEditor - Fields

After that we can see the Sum([Freight]) expression in the corresponding KpiDefinition property.

For now, we have PopupExpressionPropertyEditor for the Windows Forms applications only. And of course, its usage is not limited to KPI module. For instance, I saw several times that customers had calculated user-specified properties or formulas that could be modified by end-users at runtime. Expression Property Editor will come in very handy for such scenarios.

Happy XAFingWinking smile

7 comment(s)
Christian Andersen
Christian Andersen

This is fantastic news, great really looking forward to this.

31 May, 2011
Carlitos
Carlitos

Dennis says: "I saw several times that customers had calculated user-specified properties or formulas that could be modified by end-users at runtime. Expression Property Editor will come in very handy for such scenarios."

Can you write/show an example on how to get that done?

Thanks,

31 May, 2011
Dennis (DevExpress)
Dennis (DevExpress)

@Christian:

Thank you for the feedback!

@Carlos:

Please refer to the www.devexpress.com/.../ViewIssue.aspx ticket in the Support Center for some sample code. This ticket also contains a link to my old post in the XAF forum.

I hope you find this information helpful.

31 May, 2011
Mohsen Benkhellat
Mohsen Benkhellat

Awesome, I needed this for so long.

One question though: Are all possible expressions compatible with server mode (ie persistentalias) or is there a way to limit the user to only those?

31 May, 2011
John Botibol
John Botibol

That's great Dennis. However, as always :-) having been playing with reports today, the expression editor which pops up for a calculated field has a treeview representation of the class which is much more useful for building "real world" expressions.

Any chance of standardising this to use the treview mode?

31 May, 2011
Dennis (DevExpress)
Dennis (DevExpress)

@Mohsen:

At this time ALL fields and expressions are shown and available for selection in the editor. However, this part will be  improved in the future. We have a corresponding feature item in this regard (it also concerns Filter Editor).

1 June, 2011
Dennis (DevExpress)
Dennis (DevExpress)

@John:

Err...it is true, and we are aware of this inconsistency issue. We already started working in this direction and will standardize things all over our framework in future versions. Thank you again for your valuable feedback!

@All: Thank you for your comments!

1 June, 2011

Please login or register to post comments.