Dear support team,
I am investigating the ability to have measure metadata loaded dynamically. My approach is to have a list of measures containing the property names. Based on that I would add new DimensionMetadata with SourcePropertyName set to the aforementioned property name.
Then the cube's data type would be a DynamicObject with its TryGetMember implemented to return the value corresponding to the measure having the same name as what was specified in the SourcePropertyName.
The issue I'm facing is that TryGetMember is never called, and I suspect it is due to how SourcePropertyName is used. Is it maybe that it uses reflection to only look for public properties matching whatever is in SourcePropertyName and avoid invoking the property (which would trigger TryGetMember) if it doesn't find it?
Perhaps if you could shed some light on how SourcePropertyName is used, it would help understanding what the issue is and the feasibility of solving it.
Thanks and regards,
Tamas
Hi Tamas,
Thank you for the provided sample.
After further investigation using your sample and our code, it seems that at this point the XamPivotGrid only supports dimensions that are defined as properties in the cube’s data type. The PivotGrid actually calls the GetProperties method on the type and uses these properties when creating the dimensions. Because of this, we can’t dynamically create measures from the list property your dynamic object has defined. What I would suggest to you is to log a new product idea for this in our product ideas site.
Please let me know if you have any other questions.
Hi Dimitar,
Thanks, please see my sample attached.
Thanks,
I don’t believe the XamPivotGrid and the FlatDataSource were designed to be used with DynamicObjects. We use reflection in order to get the value and as you said this doesn’t work with DynamicObjects.Please provide me with a small sample that demonstrates what you are trying to do and I will see if there is any way to get it running with the PivotGrid.I am looking forward to hearing from you.