Пример #1
0
        public static DimensionRow Load(AdomdDataReader dataReader)
        {
            // read column 2, "CUBE_NAME"
            // read column 4, "DIMENSION_UNIQUE_NAME"
            // read column 6, "DIMENSION_CAPTION"
            // read column 8, "DIMENSION_TYPE"
            // read column 10, "DEFAULT HIERARCHY"

            var perspectiveName = (string)dataReader.GetValue(2);

            if ((short)dataReader.GetValue(8) != 2 && !perspectiveName.StartsWith("$"))
            {
                // Get the columns value
                var row = new DimensionRow();
                row.PerspectiveName  = perspectiveName;
                row.UniqueName       = (string)dataReader.GetValue(4);
                row.Caption          = (string)dataReader.GetValue(6);
                row.DefaultHierarchy = (string)dataReader.GetValue(10);
                return(row);
            }
            else
            {
                return(null);
            }
        }
Пример #2
0
        internal new IEnumerable <DimensionRow> Discover(IEnumerable <IFilter> filters)
        {
            var dimensions = new List <DimensionRow>();

            Inform("Investigating dimensions");

            using (var cmd = CreateCommand())
            {
                var adomdFiltering = Build(filters);
                cmd.CommandText = string.Format("select * from $system.mdschema_dimensions where DIMENSION_IS_VISIBLE{0}", adomdFiltering);
                var rdr = ExecuteReader(cmd);
                // Traverse the response and

                while (rdr.Read())
                {
                    var dimRow = DimensionRow.Load(rdr);
                    if (dimRow != null)
                    {
                        dimensions.Add(dimRow);
                    }
                }
            }

            return(dimensions);
        }
Пример #3
0
        public static DimensionRow LoadLinkedTo(AdomdDataReader dataReader)
        {
            // read column 2, "CUBE_NAME"
            // read column 5, "DIMENSION_UNIQUE_NAME"
            // read column 6, "DIMENSION_CAPTION"
            // read column 7, "DIMENSION_IS_VISIBLE"

            var perspectiveName = (string)dataReader.GetValue(2);
            if ((bool)dataReader.GetValue(7) && !perspectiveName.StartsWith("$"))
            {
                // Get the columns value
                var row = new DimensionRow();
                row.PerspectiveName = perspectiveName;
                row.UniqueName = dataReader.GetString(5);
                row.Caption = dataReader.GetString(5).Replace("[", "").Replace("]", "");
                return row;
            }
            else
                return null;
        }
Пример #4
0
        public static DimensionRow Load(AdomdDataReader dataReader)
        {
            // read column 2, "CUBE_NAME"
            // read column 4, "DIMENSION_UNIQUE_NAME"
            // read column 6, "DIMENSION_CAPTION"
            // read column 8, "DIMENSION_TYPE"
            // read column 10, "DEFAULT HIERARCHY"

            var perspectiveName = (string)dataReader.GetValue(2);
            if ((short)dataReader.GetValue(8) != 2 && !perspectiveName.StartsWith("$"))
            {
                // Get the columns value
                var row = new DimensionRow();
                row.PerspectiveName = perspectiveName;
                row.UniqueName = (string)dataReader.GetValue(4);
                row.Caption = (string)dataReader.GetValue(6);
                row.DefaultHierarchy = (string)dataReader.GetValue(10);
                return row;
            }
            else
                return null;
        }
Пример #5
0
        public static DimensionRow LoadLinkedTo(AdomdDataReader dataReader)
        {
            // read column 2, "CUBE_NAME"
            // read column 5, "DIMENSION_UNIQUE_NAME"
            // read column 6, "DIMENSION_CAPTION"
            // read column 7, "DIMENSION_IS_VISIBLE"

            var perspectiveName = (string)dataReader.GetValue(2);

            if ((bool)dataReader.GetValue(7) && !perspectiveName.StartsWith("$"))
            {
                // Get the columns value
                var row = new DimensionRow();
                row.PerspectiveName = perspectiveName;
                row.UniqueName      = dataReader.GetString(5);
                row.Caption         = dataReader.GetString(5).Replace("[", "").Replace("]", "");
                return(row);
            }
            else
            {
                return(null);
            }
        }
Пример #6
0
        internal IEnumerable <DimensionRow> Discover(IEnumerable <IFilter> filters)
        {
            var dimensions = new List <DimensionRow>();

            Inform("Investigating links to a measure-group");

            using (var cmd = CreateCommand())
            {
                var adomdFiltering = Build(filters);
                cmd.CommandText = string.Format("SELECT * FROM $system.mdschema_measuregroup_dimensions WHERE DIMENSION_IS_VISIBLE{0}", adomdFiltering);
                var rdr = ExecuteReader(cmd);

                while (rdr.Read())
                {
                    var row = DimensionRow.LoadLinkedTo(rdr);
                    if (row != null)
                    {
                        dimensions.Add(row);
                    }
                }
            }

            return(dimensions);
        }