Bug Report T1282732
Visible to All Users

JsonDataSource - XtraReport.FilterString does not work with properties containing the dot (.) Unicode character

created 6 months ago (modified 6 months ago)

Steps to reproduce:

  1. Create a JSON structure with dots in a property name:
JSON
[ { "units.classification": { "String Value": "FIRST", "DateTime Value": "2012-04-23T18:25:43.511Z" }, "units.digits": { "String Value": "abc 2", "Bool Value": false } }, { "units.classification": { "String Value": "SECOND", "DateTime Value": "2012-04-23T18:25:43.511Z" }, "units.digits": { "String Value": "abc 2", "Bool Value": false } } ]
  1. Apply the following filter:
    [units.classification.String Value] = 'FIRST'

Current results:

The filter does not work (all records are shown). The Expression Editor also throws an exception on selecting an inner property:
Clipboard-File-1.png

Call Stack
System.NullReferenceException: Object reference not set to an instance of an object. at DevExpress.XtraEditors.FilterControl.MenuItemPropertyClick(String propertyName) at DevExpress.XtraEditors.FilterControl.OnPropertyEditorValidated(Object sender, EventArgs e) at System.Windows.Forms.Control.OnValidated(EventArgs e) at DevExpress.XtraEditors.BaseEdit.OnValidated(EventArgs e) at DevExpress.XtraEditors.TextEdit.OnValidated(EventArgs e) at DevExpress.XtraEditors.BaseEdit.DoValidate() at DevExpress.XtraEditors.FilterControl.DoEditorValidate() at DevExpress.XtraEditors.FilterControl.<DoOperationEdtor_CloseUp>b__204_0() at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme) at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme) at System.Windows.Forms.Control.InvokeMarshaledCallbacks()

Additional information:

The Expression Binding does work: [units.classification].[String Value]

Answers approved by DevExpress Support

created 5 months ago

The core engine of our components works with a set of property descriptors. Any filter or binding expression represents a string whose syntax complies with our Criteria Language Syntax. According to the JSON RPC specification, the key is a string and a string is a sequence of Unicode characters. Unlike a .NET property, it is possible to have a dot in the JSON property's name. However, we're using a dot as a property separator in complex paths such as complexObject.Property1Nested.Property2Nested.Property3.

Supporting this edge case usage scenario across our entire component suite requires substantial resources. After careful consideration, we decided not to pursue a fix at this time. If you're also running into this issue and it significantly affects your experience or work flow, please let us know.

Possible workarounds:

  • Use the "Object Binding" approach with dots added to the [DisplayName] attribute value (only the "real" property path is saved).
  • Keep JSON but use another Unicode symbol that looks similar to a dot, for example, the one-dot leader (U+2024) Unicode character.

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.