Hi,
In the PivotDataSelector, Measure by default contains all int and double columns. Is there anyway I can make certain measures invisible.
Thanks
Sangeetha
Yes there is a way to make measure or dimention invisible. You have to set "AutoGenerateField" property to false. This is a property of DimentionMetadata which you can find in your dataSource -> CubesSettings -> CubeMetadata.
Mircho
Thank You Mircho. I just tried it. For some reason it won't work for me. What am I doing wrong?
FlatDataSource flatDataSource = DataConverter.ConvertDataTableToFlatDataSource(dt); flatDataSource.Measures = DataSourceBase.GenerateInitialItems("Effective Bid"); flatDataSource.Cube = DataSourceBase.GenerateInitialCube("Input"); flatDataSource.Columns = DataSourceBase.GenerateInitialItems("[Index Name].[Index Name]"); flatDataSource.Rows = DataSourceBase.GenerateInitialItems("[End Date].[End Date],[Gpt Name].[Gpt Name]"); CubeMetadata cubeMetaData = new CubeMetadata(); cubeMetaData.DimensionSettings.Add(new DimensionMetadata() { SourcePropertyName = "Index Id", AutoGenerateField = false }); cubeMetaData.DimensionSettings.Add(new DimensionMetadata() { SourcePropertyName = "Gpt Id", AutoGenerateField = false }); cubeMetaData.DimensionSettings.Add(new DimensionMetadata() { SourcePropertyName = "Is Active", AutoGenerateField = false }); cubeMetaData.DimensionSettings.Add(new DimensionMetadata() { SourcePropertyName = "Is Hidden", AutoGenerateField = false }); flatDataSource.CubesSettings.Add(cubeMetaData);
I works for me now. In the DimensionMetaData I had to specify the DimensionType to apply it to.
DimensionType = DimensionType.Measure.
Actually I said it too soon.
It still does not work. I must be doing something wrong. What am I doing wrong?
You have to to point for which dataSource is applied this cubeMetaData.
cubeMetaData.DataTypeFullName = flatDataSource.ItemsSource.AsQueryable().ElementType.FullName;
Works perfectly. Thanks you very much.