Exemple #1
0
        public static KpiInfo CreateKpiInfo(Kpi kpi)
        {
            if (kpi == null)
            {
                return(null);
            }
            KpiInfo info = new KpiInfo();

            info.Caption       = kpi.Caption;
            info.Description   = kpi.Description;
            info.Name          = kpi.Name;
            info.DisplayFolder = kpi.DisplayFolder;
            info.StatusGraphic = kpi.StatusGraphic;
            info.TrendGraphic  = kpi.TrendGraphic;

            // Информация о предках
            if (kpi.ParentCube != null)
            {
                info.ParentCubeId = kpi.ParentCube.Name;
            }
            if (kpi.ParentKpi != null)
            {
                info.ParentKpiId = kpi.ParentKpi.Name;
            }

            // Свойства
            foreach (Property prop in kpi.Properties)
            {
                //PropertyInfo pi = new PropertyInfo(prop.Name, prop.Type, prop.Value);
                PropertyInfo pi = new PropertyInfo(prop.Name, prop.Value);
                info.Properties.Add(pi);
            }

            return(info);
        }
        public Kpi_AreaItemWrapper(KpiInfo info, KpiControlType type)
            : base(info)
        {
            Name = info.Name;
            Type = type;
            Custom_KpiGoal = info.Custom_KpiGoal;
            Custom_KpiStatus = info.Custom_KpiStatus;
            Custom_KpiTrend = info.Custom_KpiTrend;
            Custom_KpiValue = info.Custom_KpiValue;

        }
        public static KpiInfo CreateKpiInfo(Kpi kpi)
        {
            if (kpi == null)
                return null;
            KpiInfo info = new KpiInfo();
            info.Caption = kpi.Caption;
            info.Description = kpi.Description;
            info.Name = kpi.Name;
            info.DisplayFolder = kpi.DisplayFolder;
            info.StatusGraphic = kpi.StatusGraphic;
            info.TrendGraphic = kpi.TrendGraphic;

            // Информация о предках
            if (kpi.ParentCube != null)
            {
                info.ParentCubeId = kpi.ParentCube.Name;
            }
            if (kpi.ParentKpi != null)
            {
                info.ParentKpiId = kpi.ParentKpi.Name;
            }

            // Свойства
            foreach (Property prop in kpi.Properties)
            {
                //PropertyInfo pi = new PropertyInfo(prop.Name, prop.Type, prop.Value);
                PropertyInfo pi = new PropertyInfo(prop.Name, prop.Value);
                info.Properties.Add(pi);
            }

            return info;
        }
 private string GenerateQueryForRow(KpiInfo info)
 {
     string variance = String.Format("with member [Variance] as " + KPIValue, info.Caption) + String.Format("-"+KPIGoal,info.Caption);
     string id = String.Format(" member [Id] as \"{0}\"", info.Name);
     string result = variance + id + " SELECT { [Id], ";
     result += String.Format(KPIValue + " , ", info.Caption);
     result += String.Format(KPIGoal + " , ", info.Caption);
     result += " [Variance], ";
     result += String.Format(KPIStatus + " , ", info.Caption);
     result += String.Format(KPITrend + " , ", info.Caption);
     result += String.Format(KPIWeight, info.Caption) + " } ";
     string prop1 =
         "DIMENSION PROPERTIES PARENT_UNIQUE_NAME , HIERARCHY_UNIQUE_NAME , CUSTOM_ROLLUP , UNARY_OPERATOR , KEY0 ON 0 ";
     String cube = String.Format("FROM [{0}] ",m_CubeName);
     string prop2 =
         "CELL PROPERTIES BACK_COLOR , CELL_ORDINAL , FORE_COLOR , FONT_NAME , FONT_SIZE , FONT_FLAGS , FORMAT_STRING , VALUE , FORMATTED_VALUE , UPDATEABLE";
     return result + prop1 + cube + prop2;
 }
 private KpiView GetKpiViewItem(KpiView kpiView, KpiInfo info)
 {
     var row = new KpiView();
     if (kpiView != null)
     {
         row.Caption = kpiView.Caption;
         row.KpiGoal = kpiView.KpiGoal;
         row.KpiValue = kpiView.KpiValue;
         //row.KpiValue = view.Value.KpiValue;
         row.KpiTrend = kpiView.KpiTrend;
         row.KpiStatus = kpiView.KpiStatus;
         //row.DisplayFolder = view.Value.DisplayFolder;
         row.KpiVariance = kpiView.KpiVariance;
         //row.KpiVariance = view.Value.KpiVariance;                                
         row.DisplayFolder = info.DisplayFolder;
         row.StatusGraphic = info.StatusGraphic + "_" + row.KpiStatus + ".png";
         row.TrendGraphic = info.TrendGraphic + "_" + row.KpiTrend + ".png";
     }
     return row;
 }
 public KpiTrendTreeNode(KpiInfo info)
     : base(info)
 {
     Icon = UriResources.Images.Kpi16;
     Text = "Trend";
 }
 public KpiStatusTreeNode(KpiInfo info)
     : base(info)
 {
     Icon = UriResources.Images.Kpi16;
     Text = "Status";
 }
 public KpiValueTreeNode(KpiInfo info)
     : base(info)
 {
     Icon = UriResources.Images.Kpi16;
     Text = "Value";
 }
 public KpiGoalTreeNode(KpiInfo info)
     : base(info)
 {
     Icon = UriResources.Images.Kpi16;
     Text = "Goal";
 }