예제 #1
0
        private Level[] GetProblemLevels(Microsoft.AnalysisServices.BackEnd.DataModelingSandbox sandboxParam)
        {
#if DENALI || SQL2014
            var sandbox = sandboxParam;
#else
            var sandbox = (Microsoft.AnalysisServices.BackEnd.DataModelingSandboxAmo)sandboxParam.Impl;
#endif
            List <Level> levels = new List <Level>();
            SSAS.TabularHideMemberIfAnnotation annotation = GetAnnotation(sandboxParam);
            foreach (Dimension d in sandbox.Database.Dimensions)
            {
                foreach (Hierarchy h in d.Hierarchies)
                {
                    foreach (Level l in h.Levels)
                    {
                        SSAS.TabularLevelHideMemberIf levelAnnotation = annotation.Find(l);
                        if (levelAnnotation != null)
                        {
                            if (levelAnnotation.HideMemberIf != l.HideMemberIf)
                            {
                                levels.Add(l);
                            }
                        }
                    }
                }
            }
            return(levels.ToArray());
        }
예제 #2
0
        public void FixPreBuildWarning(Microsoft.AnalysisServices.BackEnd.DataModelingSandbox sandbox)
        {
            SSAS.TabularHideMemberIfAnnotation     annotation = GetAnnotation(sandbox);
            List <Tuple <string, string, string> > levels     = new List <Tuple <string, string, string> >();
            List <HideIfValue> values = new List <HideIfValue>();

            foreach (Level l in GetProblemLevels(sandbox))
            {
                SSAS.TabularLevelHideMemberIf levelAnnotation = annotation.Find(l);
                levels.Add(new Tuple <string, string, string>(l.ParentDimension.Name, l.Parent.Name, l.Name));
                values.Add(levelAnnotation.HideMemberIf);
            }
            SetHideMemberIf(sandbox, levels, values);
        }
 public void Set(Microsoft.AnalysisServices.Level level)
 {
     TabularLevelHideMemberIf levelAnnotation = Find(level);
     if (levelAnnotation == null)
     {
         List<TabularLevelHideMemberIf> levels = new List<TabularLevelHideMemberIf>(TabularLevels ?? new TabularLevelHideMemberIf[] { });
         levelAnnotation = new TabularLevelHideMemberIf();
         levelAnnotation.DimensionID = level.ParentDimension.ID;
         levelAnnotation.HierarchyID = level.Parent.ID;
         levelAnnotation.LevelID = level.ID;
         levels.Add(levelAnnotation);
         TabularLevels = levels.ToArray();
     }
     levelAnnotation.HideMemberIf = level.HideMemberIf;
 }
        public void Set(Microsoft.AnalysisServices.Level level)
        {
            TabularLevelHideMemberIf levelAnnotation = Find(level);

            if (levelAnnotation == null)
            {
                List <TabularLevelHideMemberIf> levels = new List <TabularLevelHideMemberIf>(TabularLevels ?? new TabularLevelHideMemberIf[] { });
                levelAnnotation             = new TabularLevelHideMemberIf();
                levelAnnotation.DimensionID = level.ParentDimension.ID;
                levelAnnotation.HierarchyID = level.Parent.ID;
                levelAnnotation.LevelID     = level.ID;
                levels.Add(levelAnnotation);
                TabularLevels = levels.ToArray();
            }
            levelAnnotation.HideMemberIf = level.HideMemberIf;
        }