Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
PivotGrid - How to set numeric properties as Dimension
posted

Hi!

I'm having a problem to set some numerics properties as Dimension, bydefault they come(in Olap cubeGeneration) as measures, but I need to get them out of that field and set those properties to Dimensions.

In the Documentation i found something like "InitializeOlapAxisElementDescriptor", but it doesnt works in my case... Have it Another way?

  • 34430
    Offline posted

    Hello Vinicius,

    You are on the right track with the InitializeOlapAxisElementDescriptor event of your OLAP data source.

    Using this event, you can use code like the following to create a Dimension from something that would normally be a Measure:

            private void Ds_InitializeOlapAxisElementDescriptor(object sender, InitializeOlapAxisElementDescriptorEventArgs e)
            {
                if(e.OlapElementDescriptor is MeasureDescriptor)
                {
                    e.OlapElementDescriptor = new HierarchyDescriptor(e.PropertyDescriptor);
                }            
            }

    Please let me know if you have any other questions or concerns on this matter.