I have placed a pivot grid and data selector on one user control. I am using flatdatasource for pivot. To add measures, I have written the code something like this...
cubeMetadataValues.DimensionSettings.Add(new DimensionMetadata() { SourcePropertyName = "CostPrice", DisplayName = "Cost Price", DimensionType = DimensionType.Measure, GroupName = "Price" }); cubeMetadataValues.DimensionSettings.Add(new DimensionMetadata() { SourcePropertyName = "OriginalPrice", DisplayName = "Original Price", DimensionType = DimensionType.Measure, GroupName = "Price" });
I can see the groups created in Measures section of pivot data selector as seen in attachment.
How to create such groups for all the dimensions? I've more than 30 dimensions to show in data selector control and would like to organize them in logical groups. Has anyone did something like this? Any code sample would be appriciated.
Thanks,
Regards,
Rohan Bhat
Hello Rohan,
Thank you for your post. I have been looking into it and I can say that the approach you use seems to be the best one for achieving the functionality you want, so I can suggest you use it for all your dimensions. Also if I think of a better solution I will let you know.
Hope this helps you.
Hi Stefan,
Thanks for your reply.
cubeMetadataValues.DimensionSettings.Add(new DimensionMetadata() { SourcePropertyName = "RetailProductID", DisplayName = "Product", DimensionType = DimensionType.Dimension, GroupName = "Product" });
Please see above lines of code. I am adding dimensions and measures in a way shown above. As you've suggested, I've specified "GroupName" for all the measures and dimensions while adding them to "cubeMetadataValues.DimensionSettings". I can see groups created for measures only, and all dimensions are listed one below another. There are no groups shown. You can see the attached image - There are 4 groups - Forecast, Price, Sales and Stock under Measures. And all other dimensions are listed without any groups one after the other. Could you please let me know how to group them in the same way as measures?
I am using MetadataTreeItemAdding event to skip some of the measures/dimensions to be added to the data selector control. Do you think that affects groups creation for dimensions?
Rohan