Hi,
I have a collection of one class which has "nested collection of another class" as its property. Consider following class for example,
public class SOHoldingUIEntity { public StockOptimisationStockHoldingEntity soh { get; set; } public string group_header { get; set; } public ObservableCollection<StockOptimisationStockHoldingItemEntity> soitems { get; set; } public SOHoldingUIEntity() { soitems = new ObservableCollection<StockOptimisationStockHoldingItemEntity>(); } }
I need to display pivot using Observable Collection of SOHoldingUIEntity class (using flat data source). How to bring up properties of StockOptimisationStockHoldingEntity in pivot data selector?
Has anyone created such pivot? Could someone please help me on this?
Thanks in advance...
Hi George,
Thanks a lot for your help. I tried the approach you've suggested in sample solution and it worked exactly in a way I wanted...
Thanks once again... :)
Regards,
Rohan
Hi Rohan,
Were you able to resolve your issue?
Thanks,
George
Attached you can find a solution with "flatten" data.
No, I could not resolve my issue with HierarchyDescriptor as suggested by you. I don't think HierarchyDescriptor will be of any use here.
On all other pivots I've developed; I'm getting data in observable collection of some class and I simply add all it's properties in CubeMetadata object as follows:
CubeMetadata cubeMetadataValues = new CubeMetadata(); cubeMetadataValues.DisplayName = "cubeMetaDataDisplayName"; cubeMetadataValues.DataTypeFullName = typeof(<MyClassName>).FullName;
And then, I simply add properties as follows:
cubeMetadataValues.DimensionSettings.Add(new DimensionMetadata() { SourcePropertyName = "RetailProductID", DisplayName = "Product", DimensionType = DimensionType.Dimension, GroupName = "Product" });
cubeMetadataValues.DimensionSettings.Add(new DimensionMetadata() { SourcePropertyName = "Color", DisplayName = "Color", DimensionType = DimensionType.Dimension, GroupName = "Product" }); cubeMetadataValues.DimensionSettings.Add(new DimensionMetadata() { SourcePropertyName = "Description", DisplayName = "Description", DimensionType = DimensionType.Dimension, GroupName = "Product" });
This way, all the properties are listed in Pivot's data selector control.
My problem gets complicated when I get data in observable collection of type similar to this:
public class SOHoldingUIEntity{ public StockOptimisationStockHoldingEntity soh { get; set; } public string group_header { get; set; } public ObservableCollection<StockOptimisationStockHoldingItemEntity> soitems { get; set; } public SOHoldingUIEntity() { soitems = new ObservableCollection<StockOptimisationStockHoldingItemEntity>(); }}
And I want to add all the properties of "StockOptimisationStockHoldingEntity" (in above class) to CubeMetadata object to get them on Pivot's data selector. I am not able to understand how to create custom Enumerator using LINQ, as you said, and use it to generate pivot. Since I've to specify the fully qualified assembly name or class name in the statement => cubeMetadataValues.DataTypeFullName = dataTypeFullName;
Again, I am not willing to create Hierarchy of properties of "StockOptimisationStockHoldingEntity" class. I just wanted to list them all one below the other in pivot's data selector. User of the pivot can drag-n-drop any dimension/measure to pivot to see the analysis.
I have tried to explain my problem in details here. I hope you get that! Let me know if you further need any clarification.
Thanks once again for your time...
Cheers,
Hi rohanb,