public void InitLeft() { this.Left.AddTable(); string paras = this.ur.Paras; #region 项 this.Left.AddTR(); this.Left.AddTDTitle("colspan=2", "分析数据"); this.Left.AddTREnd(); DDL ddl = new DDL(); ddl.ID = "DDL_Num"; ddl.AutoPostBack = true; ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged); ListItem li = null; this.Left.AddTR(); this.Left.AddTD("数据项"); Attrs attrs = this.HisMD.AttrsInTableEns; attrs.AddTBInt("MyNum", 1, "流程数量", true, true); foreach (Attr attr in attrs) { if (attr.UIContralType != UIContralType.TB) { continue; } if (attr.UIVisible == false) { continue; } if (attr.IsNum == false) { continue; } if (attr.Key == "OID" || attr.Key == "WorkID" || attr.Key == "FID" || attr.Key == "MID") { continue; } li = new ListItem(attr.Desc, attr.Key); if (paras.Contains("@Num=" + attr.Key)) { li.Selected = true; } ddl.Items.Add(li); } this.Left.AddTD(ddl); this.Left.AddTREnd(); this.Left.AddTR(); this.Left.AddTD("分析方式"); ddl = new DDL(); ddl.ID = "DDL_FXWay"; ddl.AutoPostBack = true; li = new ListItem("求和", "SUM"); if (paras.Contains("@FXWay=SUM")) { li.Selected = true; } ddl.Items.Add(li); li = new ListItem("求平均", "AVG"); if (paras.Contains("@FXWay=AVG")) { li.Selected = true; } ddl.Items.Add(li); ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged); this.Left.AddTD(ddl); this.Left.AddTREnd(); ddl = new DDL(); ddl.ID = "DDL_Order"; ddl.AutoPostBack = true; ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged); li = new ListItem("升序", "UP"); if (paras.Contains("@Order=UP")) { li.Selected = true; } ddl.Items.Add(li); li = new ListItem("降序", "DESC"); if (paras.Contains("@Order=DESC")) { li.Selected = true; } ddl.Items.Add(li); this.Left.AddTR(); this.Left.AddTD("排序方式"); this.Left.AddTD(ddl); this.Left.AddTREnd(); #endregion 项 #region 比较对象 this.Left.AddTR(); this.Left.AddTDTitle("colspan=2", "比较内容"); this.Left.AddTREnd(); ddl = new DDL(); ddl.ID = "DDL_D"; ddl.AutoPostBack = true; ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged); this.Left.AddTR(); this.Left.AddTD("比较选项"); string dAttr = null; foreach (Attr attr in attrs) { if (attr.UIContralType == UIContralType.DDL) { li = new ListItem(attr.Desc, attr.Key); if (paras.Contains("@D=" + attr.Key)) { dAttr = attr.Key; li.Selected = true; } ddl.Items.Add(li); } } this.Left.AddTD(ddl); this.Left.AddTREnd(); /*获取分析项目的数据。*/ SysEnums sesD = null; Entities ensD = null; Map map = this.HisMD.HisEn.EnMap; Attr attrD1 = attrs.GetAttrByKey(this.DDL_D.SelectedItemStringVal); if (attrD1.IsEnum) { sesD = new SysEnums(attrD1.UIBindKey); } else { ensD = attrD1.HisFKEns; } this.Left.AddTR(); this.Left.AddTD("基准项目"); ddl = new DDL(); ddl.ID = "DDL_V1"; ddl.AutoPostBack = true; ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged); if (sesD != null) { if (sesD.Count == 0) { throw new Exception(attrD1.UIBindKey); } foreach (SysEnum se in sesD) { li = new ListItem(se.Lab, se.IntKey.ToString()); if (paras.Contains("@V1=" + se.IntKey)) { li.Selected = true; } ddl.Items.Add(li); } } if (ensD != null) { ensD.RetrieveAll(); if (ensD.Count == 0) { ensD.RetrieveAll(); } // throw new Exception(attrD1.UIBindKey); foreach (Entity en in ensD) { li = new ListItem(en.GetValStrByKey("Name"), en.GetValStrByKey("No")); if (paras.Contains("@V1=" + li.Value)) { li.Selected = true; } ddl.Items.Add(li); } } this.Left.AddTD(ddl); this.Left.AddTREnd(); this.Left.AddTR(); this.Left.AddTD("对比项目"); ddl = new DDL(); ddl.ID = "DDL_V2"; ddl.AutoPostBack = true; ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged); if (sesD != null) { foreach (SysEnum se in sesD) { li = new ListItem(se.Lab, se.IntKey.ToString()); if (paras.Contains("@V2=" + se.IntKey)) { li.Selected = true; } ddl.Items.Add(li); } } if (ensD != null) { foreach (Entity en in ensD) { li = new ListItem(en.GetValStrByKey("Name"), en.GetValStrByKey("No")); if (paras.Contains("@V2=" + li.Value)) { li.Selected = true; } ddl.Items.Add(li); } } this.Left.AddTD(ddl); this.Left.AddTREnd(); #endregion 横纬度 ddl = new DDL(); ddl.ID = "DDL_Group"; ddl.AutoPostBack = true; ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged); this.Left.AddTR(); this.Left.AddTD("分组项目"); foreach (Attr attr in attrs) { if (attr.UIContralType == UIContralType.DDL) { li = new ListItem(attr.Desc, attr.Key); if (paras.Contains("@Group=" + attr.Key)) { li.Selected = true; } ddl.Items.Add(li); } } this.Left.AddTD(ddl); this.Left.AddTREnd(); this.Left.AddTableEnd(); }
/// <summary> /// 初始化left. /// </summary> public void InitLeft() { this.Left.AddTable("class='Table' cellspacing='0' cellpadding='0' border='0' style='width:100%'"); string paras = this.ur.Paras; #region 项 this.Left.AddTR(); this.Left.AddTDGroupTitle("colspan=2", "选项"); this.Left.AddTREnd(); DDL ddl = new DDL(); ddl.ID = "DDL_Num"; ddl.AutoPostBack = true; ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged); ListItem li = null; this.Left.AddTR(); this.Left.AddTD("分析数据:"); Attrs attrs = this.currEn.EnMap.Attrs;; attrs.AddTBInt("MyNum", 1, "流程数量", true, true); foreach (Attr attr in attrs) { if (attr.UIContralType != UIContralType.TB) { continue; } if (attr.UIVisible == false) { continue; } if (attr.IsNum == false) { continue; } //去掉特殊的字段. switch (attr.Key) { case NDXRptBaseAttr.OID: case "MID": case NDXRptBaseAttr.PWorkID: case NDXRptBaseAttr.FID: case NDXRptBaseAttr.FlowEndNode: case "WorkID": continue; default: break; } li = new ListItem(attr.Desc, attr.Key); if (paras.Contains("@Num=" + attr.Key)) { li.Selected = true; } ddl.Items.Add(li); } this.Left.AddTD(ddl); this.Left.AddTREnd(); this.Left.AddTR(); this.Left.AddTD("分析方式:"); ddl = new DDL(); ddl.ID = "DDL_FXWay"; ddl.AutoPostBack = true; li = new ListItem("求和", "SUM"); if (paras.Contains("@FXWay=SUM")) { li.Selected = true; } ddl.Items.Add(li); li = new ListItem("求平均", "AVG"); if (paras.Contains("@FXWay=AVG")) { li.Selected = true; } ddl.Items.Add(li); ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged); this.Left.AddTD(ddl); this.Left.AddTREnd(); this.Left.AddTR(); CheckBox cb = new CheckBox(); cb.AutoPostBack = true; cb.ID = "CB_IsRate"; cb.Text = "显示百分比"; if (paras.Contains("@IsRate=1")) { cb.Checked = true; } else { cb.Checked = false; } cb.CheckedChanged += new EventHandler(cb_CheckedChanged); this.Left.AddTD(cb); cb = new CheckBox(); cb.ID = "CB_IsImg"; cb.AutoPostBack = true; if (paras.Contains("@IsImg=1")) { cb.Checked = true; } else { cb.Checked = false; } cb.Text = "显示图形"; cb.CheckedChanged += new EventHandler(cb_CheckedChanged); this.Left.AddTD(cb); this.Left.AddTREnd(); AtPara ps = new AtPara(paras); this.Left.AddTR(); this.Left.AddTDBegin(); TextBox tb = new TextBox(); tb.Width = 40; tb.ID = "TB_W"; tb.BorderWidth = 1; //tb.BorderStyle = BorderStyle.Outset; tb.Text = ps.GetValStrByKey("W"); if (string.IsNullOrEmpty(tb.Text)) { tb.Text = "500"; } this.Left.Add("宽:"); this.Left.Add(tb); this.Left.AddTDEnd(); this.Left.AddTDBegin(); this.Left.Add("高:"); tb = new TextBox(); tb.Width = 40; tb.ID = "TB_H"; tb.BorderWidth = 1; //tb.BorderStyle = BorderStyle.Outset; tb.Text = ps.GetValStrByKey("H"); if (string.IsNullOrEmpty(tb.Text)) { tb.Text = "300"; } this.Left.Add(tb); this.Left.AddTDEnd(); this.Left.AddTREnd(); this.Left.AddTR(); cb = new CheckBox(); cb.AutoPostBack = true; cb.ID = "CB_IsNull"; cb.Text = "过滤为null值的数据"; if (paras.Contains("@IsNull=1")) { cb.Checked = true; } else { cb.Checked = false; } cb.CheckedChanged += new EventHandler(cb_CheckedChanged); this.Left.AddTD("colspan=2", cb); this.Left.AddTREnd(); #endregion 项 #region 横纬度 this.Left.AddTR(); this.Left.AddTDGroupTitle("colspan='2'", "横纬度 - <a href=# >横竖互换</a>"); this.Left.AddTREnd(); ddl = new DDL(); ddl.ID = "DDL_D1"; ddl.AutoPostBack = true; ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged); this.Left.AddTR(); this.Left.AddTD("纬度项目:"); foreach (Attr attr in attrs) { if (attr.UIContralType == UIContralType.DDL) { li = new ListItem(attr.Desc, attr.Key); if (paras.Contains("@D1=" + attr.Key)) { li.Selected = true; } ddl.Items.Add(new ListItem(attr.Desc, attr.Key)); } } this.Left.AddTD(ddl); this.Left.AddTREnd(); ddl = new DDL(); ddl.ID = "DDL_D1_Order"; ddl.AutoPostBack = true; ddl.Items.Add(new ListItem("升序", "Up")); ddl.Items.Add(new ListItem("降序", "Desc")); if (paras.Contains("@D1_Order=Up")) { li.Selected = true; } else { li.Selected = false; } this.Left.AddTR(); this.Left.AddTD("排序方式:"); this.Left.AddTD(ddl); this.Left.AddTREnd(); #endregion 横纬度 #region 纵纬度 this.Left.AddTR(); this.Left.AddTDGroupTitle("colspan='2'", "纵纬度"); this.Left.AddTREnd(); this.Left.AddTR(); this.Left.AddTD("数据项目:"); ddl = new DDL(); ddl.ID = "DDL_D2"; ddl.AutoPostBack = true; ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged); foreach (Attr attr in attrs) { if (attr.UIContralType == UIContralType.DDL) { li = new ListItem(attr.Desc, attr.Key); if (paras.Contains("@D2=" + attr.Key)) { li.Selected = true; } ddl.Items.Add(new ListItem(attr.Desc, attr.Key)); } } this.Left.AddTD(ddl); this.Left.AddTREnd(); ddl = new DDL(); ddl.ID = "DDL_D2_Order"; ddl.AutoPostBack = true; ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged); ddl.Items.Add(new ListItem("升序", "")); ddl.Items.Add(new ListItem("降序", "DESC")); if (paras.Contains("@D2_Order=Up")) { li.Selected = true; } else { li.Selected = false; } this.Left.AddTR(); this.Left.AddTD("排序方式:"); this.Left.AddTD(ddl); this.Left.AddTREnd(); #endregion 纵纬度 this.Left.AddTableEnd(); //#region 纵纬度1 //this.Left.AddTR(); //this.Left.AddTDTitle("colspan=2", "纵纬度2"); //this.Left.AddTREnd(); //this.Left.AddTR(); //this.Left.AddTD("数据项目"); //ddl = new DDL(); //ddl.ID = "DDL_D3"; //foreach (MapAttr attr in this.HisMAs) //{ // if (attr.UIBindKey == "") // continue; // ddl.Items.Add(new ListItem(attr.Name, attr.KeyOfEn)); //} //this.Left.AddTD(ddl); //this.Left.AddTREnd(); //ddl = new DDL(); //ddl.ID = "DDL_D3_Order"; //ddl.Items.Add(new ListItem("升序", "")); //ddl.Items.Add(new ListItem("降序", "DESC")); //this.Left.AddTR(); //this.Left.AddTD("排序方式"); //this.Left.AddTD(ddl); //this.Left.AddTREnd(); //#endregion 纵纬度2 }