Beispiel #1
0
        //统计
        private void barButtonItem6_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            FormChooseYears frm = new FormChooseYears();

            frm.NoIncreaseRate = true;
            foreach (TreeListColumn column in treeList1.Columns)
            {
                if (column.FieldName.IndexOf("年") > 0)
                {
                    frm.ListYearsForChoose.Add((int)column.Tag);
                }
            }

            if (frm.ShowDialog() == DialogResult.OK)
            {
                Form1Result f = new Form1Result();
                f.CanPrint      = base.PrintRight;
                f.Text          = Title = "分区块电力电量平衡表";// +frm.ListChoosedYears[0].Year + "~" + frm.ListChoosedYears[frm.ListChoosedYears.Count - 1].Year + "年经济和电力发展实绩";
                f.UnitHeader    = Unit = "单位:万千瓦、万千乏";
                f.ColTitleWidth = 230;
                f.GridDataTable = ResultDataTable(ConvertTreeListToDataTable(treeList1), frm.ListChoosedYears);
                f.IsSelect      = IsSelect;
                DialogResult dr = f.ShowDialog();
                if (IsSelect && dr == DialogResult.OK)
                {
                    Gcontrol     = f.gridControl1;
                    DialogResult = DialogResult.OK;
                }
            }
        }
Beispiel #2
0
        //统计
        private void barButtonItem6_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            FormChooseYears frm = new FormChooseYears();

            foreach (TreeListColumn column in treeList1.Columns)
            {
                if (column.FieldName.IndexOf("年") > 0)
                {
                    frm.ListYearsForChoose.Add((int)column.Tag);
                }
            }

            if (frm.ShowDialog() == DialogResult.OK)
            {
                Form1Result f = new Form1Result();
                f.CanPrint      = base.PrintRight;
                f.Text          = Title = "本地区" + frm.ListChoosedYears[0].Year + "~" + frm.ListChoosedYears[frm.ListChoosedYears.Count - 1].Year + "年经济和电力发展实绩";
                f.GridDataTable = ResultDataTable1(ConvertTreeListToDataTable(treeList1), frm.ListChoosedYears);
                f.IsSelect      = IsSelect;
                DialogResult dr = f.ShowDialog();
                //f.ShowDialog();
                if (IsSelect && dr == DialogResult.OK)
                {
                    Gcontrol     = f.gridControl1;
                    Unit         = "单位:万元、小时、万千瓦时、万千瓦、万人";
                    DialogResult = DialogResult.OK;
                }
                try
                {
                    //barManager1.Bars.Clear();
                    //    this.barManager1.Bars.Add(bar1);
                }
                catch { }
            }
        }
Beispiel #3
0
        //统计
        private void barButtonItem6_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            FormChooseYears frm = new FormChooseYears();

            frm.NoIncreaseRate = true;

            foreach (TreeListNode node in treeList1.Nodes)
            {
                frm.ListYearsForChoose.Add((int)node["Year"]);
            }

            if (frm.ShowDialog() == DialogResult.OK)
            {
                Form14Result f = new Form14Result();
                f.CanPrint      = base.PrintRight;
                f.Text          = Title = "本地区电网110kV变电容量平衡表";
                f.GridDataTable = ConvertTreeListToDataTable(treeList1, frm.ListChoosedYears);
                f.IsSelect      = IsSelect;
                DialogResult dr = f.ShowDialog();
                if (IsSelect && dr == DialogResult.OK)
                {
                    Gcontrol     = f.gridControl1;
                    Unit         = "单位:万千瓦、万千伏安";
                    DialogResult = DialogResult.OK;
                }
            }
        }
Beispiel #4
0
        //统计
        private void barButtonItem6_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            FormChooseYears frm = new FormChooseYears();

            foreach (TreeListColumn column in treeList1.Columns)
            {
                if (column.FieldName.IndexOf("年") > 0)
                {
                    frm.ListYearsForChoose.Add((int)column.Tag);
                }
            }
            frm.NoIncreaseRate = true;

            if (frm.ShowDialog() == DialogResult.OK)
            {
                //////////Form1Result f = new Form1Result();
                //////////f.CanPrint = base.PrintRight;
                //////////f.Text = Title = "本地区电力平衡表";// + frm.ListChoosedYears[0].Year + "~" + frm.ListChoosedYears[frm.ListChoosedYears.Count - 1].Year + "年经济和电力发展实绩";
                //////////f.ColTitleWidth = 250;
                //////////f.ColTitleAlign = DevExpress.Utils.HorzAlignment.Default;
                //////////f.GridDataTable = ResultDataTable(ConvertTreeListToDataTable(treeList1), frm.ListChoosedYears);
                //////////f.IsSelect = IsSelect;
                //////////DialogResult dr = f.ShowDialog();
                //////////if (IsSelect && dr == DialogResult.OK)
                //////////{
                //////////    Gcontrol = f.gridControl1;
                //////////    Unit = "单位:万千瓦";
                //////////    DialogResult = DialogResult.OK;
                //////////}


                Form21Print frma = new Form21Print();
                frma.IsSelect = _isSelect;
                frma.Text     = "本地区电力平衡表";
                DataTable dt = ConvertTreeListToDataTable(treeList1);

                frma.GridDataTable = ResultDataTable(ConvertTreeListToDataTable(treeList1), frm.ListChoosedYears);


                if (frma.ShowDialog() == DialogResult.OK && _isSelect)
                {
                    //gcontrol = frm.gridControl1;
                    //title = frm.Title;
                    //unit = "单位:万元";
                    DialogResult = DialogResult.OK;
                }
            }
        }
Beispiel #5
0
        //统计
        private void barButtonItem6_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            FormChooseYears frm = new FormChooseYears();

            foreach (TreeListColumn column in treeList1.Columns)
            {
                if (column.FieldName.IndexOf("年") > 0)
                {
                    frm.ListYearsForChoose.Add((int)column.Tag);
                }
            }

            if (frm.ShowDialog() == DialogResult.OK)
            {
                Form1Result f = new Form1Result();
                f.Text          = "本地区" + frm.ListChoosedYears[0].Year + "~" + frm.ListChoosedYears[frm.ListChoosedYears.Count - 1].Year + "年最高负荷预测表";
                f.GridDataTable = ResultDataTable(ConvertTreeListToDataTable(treeList1), frm.ListChoosedYears);
                f.ShowDialog();
            }
        }
Beispiel #6
0
        //ͳ��
        private void barButtonItem6_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            FormChooseYears frm = new FormChooseYears();
            foreach (TreeListColumn column in treeList1.Columns)
            {
                if (column.FieldName.IndexOf("��") > 0)
                {
                    frm.ListYearsForChoose.Add((int)column.Tag);
                }
            }

            if (frm.ShowDialog() == DialogResult.OK)
            {
                Form1Result f = new Form1Result();
                f.CanPrint = CanPrint;
                f.Text = forecastReport.Title;//  = "������" + frm.ListChoosedYears[0].Year + "��" + frm.ListChoosedYears[frm.ListChoosedYears.Count - 1].Year + "����߸���Ԥ���";
                f.GridDataTable = ResultDataTable(ConvertTreeListToDataTable(treeList1), frm.ListChoosedYears);
                f.IsSelect = IsSelect;
                DialogResult dr = f.ShowDialog();
                if (IsSelect && dr == DialogResult.OK)
                {
                    GridControl = f.gridControl1;
                    DialogResult = DialogResult.OK;
                }
            }
        }
Beispiel #7
0
        //统计
        private void barButtonItem6_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            FormChooseYears frm = new FormChooseYears();
            frm.NoIncreaseRate = true;
            foreach (TreeListColumn column in treeList1.Columns)
            {
                if (column.FieldName.IndexOf("年") > 0)
                {
                    frm.ListYearsForChoose.Add((int)column.Tag);
                }
            }

            if(frm.ShowDialog() == DialogResult.OK)
            {
                Form1Result f = new Form1Result();
                f.CanPrint = base.PrintRight;
                f.Text = Title = "分区块电力电量平衡表";// +frm.ListChoosedYears[0].Year + "~" + frm.ListChoosedYears[frm.ListChoosedYears.Count - 1].Year + "年经济和电力发展实绩";
                f.UnitHeader = Unit = "单位:万千瓦、万千乏";
                f.ColTitleWidth = 230;
                f.GridDataTable = ResultDataTable(ConvertTreeListToDataTable(treeList1), frm.ListChoosedYears);
                f.IsSelect = IsSelect;
                DialogResult dr = f.ShowDialog();
                if (IsSelect && dr == DialogResult.OK)
                {
                    Gcontrol = f.gridControl1;
                    DialogResult = DialogResult.OK;
                }
            }
        }
Beispiel #8
0
        //统计
        private void barButtonItem6_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            FormChooseYears frm = new FormChooseYears();
            foreach (TreeListColumn column in treeList1.Columns)
            {
                if (column.FieldName.IndexOf("年") > 0)
                {
                    frm.ListYearsForChoose.Add((int)column.Tag);
                }
            }

            if(frm.ShowDialog() == DialogResult.OK)
            {
                Form1Result f = new Form1Result();
                f.CanPrint = base.PrintRight;
                f.Text = Title = "本地区" + frm.ListChoosedYears[0].Year + "~" + frm.ListChoosedYears[frm.ListChoosedYears.Count - 1].Year + "年经济和电力发展实绩";
                f.GridDataTable = ResultDataTable1(ConvertTreeListToDataTable(treeList1), frm.ListChoosedYears);
                f.IsSelect = IsSelect;
                DialogResult dr = f.ShowDialog();
                //f.ShowDialog();
                if (IsSelect && dr == DialogResult.OK)
                {
                    Gcontrol = f.gridControl1;
                    Unit = "单位:万元、小时、万千瓦时、万千瓦、万人";
                    DialogResult = DialogResult.OK;
                }
                try
                {

                    //barManager1.Bars.Clear();
                    //    this.barManager1.Bars.Add(bar1);
                }
                catch { }
            }
        }
Beispiel #9
0
        //ͳ��
        private void barButtonItem6_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            FormChooseYears frm = new FormChooseYears();
            foreach (TreeListColumn column in treeList1.Columns)
            {
                if (column.FieldName.IndexOf("��") > 0)
                {
                    frm.ListYearsForChoose.Add((int)column.Tag);
                }
            }

            if (frm.ShowDialog() == DialogResult.OK)
            {
                Form1Result f = new Form1Result();
                f.Text = "������" + frm.ListChoosedYears[0].Year + "��" + frm.ListChoosedYears[frm.ListChoosedYears.Count - 1].Year + "����߸���Ԥ���";
                f.GridDataTable = ResultDataTable(ConvertTreeListToDataTable(treeList1), frm.ListChoosedYears);
                f.ShowDialog();
            }
        }
Beispiel #10
0
        //统计
        private void barButtonItem6_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            FormChooseYears frm = new FormChooseYears();
            foreach (TreeListColumn column in treeList1.Columns)
            {
                if (column.FieldName.IndexOf("年") > 0)
                {
                    frm.ListYearsForChoose.Add((int)column.Tag);
                }
            }
            frm.NoIncreaseRate = true;

            if(frm.ShowDialog() == DialogResult.OK)
            {
                //////////Form1Result f = new Form1Result();
                //////////f.CanPrint = base.PrintRight;
                //////////f.Text = Title = "本地区电力平衡表";// + frm.ListChoosedYears[0].Year + "~" + frm.ListChoosedYears[frm.ListChoosedYears.Count - 1].Year + "年经济和电力发展实绩";
                //////////f.ColTitleWidth = 250;
                //////////f.ColTitleAlign = DevExpress.Utils.HorzAlignment.Default;
                //////////f.GridDataTable = ResultDataTable(ConvertTreeListToDataTable(treeList1), frm.ListChoosedYears);
                //////////f.IsSelect = IsSelect;
                //////////DialogResult dr = f.ShowDialog();
                //////////if (IsSelect && dr == DialogResult.OK)
                //////////{
                //////////    Gcontrol = f.gridControl1;
                //////////    Unit = "单位:万千瓦";
                //////////    DialogResult = DialogResult.OK;
                //////////}

                Form21Print frma = new Form21Print();
                frma.IsSelect = _isSelect;
                frma.Text = "本地区电力平衡表";
                DataTable dt = ConvertTreeListToDataTable(treeList1);

                frma.GridDataTable  = ResultDataTable(ConvertTreeListToDataTable(treeList1), frm.ListChoosedYears);

                if (frma.ShowDialog() == DialogResult.OK && _isSelect)
                {
                    //gcontrol = frm.gridControl1;
                    //title = frm.Title;
                    //unit = "单位:万元";
                    DialogResult = DialogResult.OK;
                }

            }
        }
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            PSP_VolumeBalance vol = new PSP_VolumeBalance();
            vol.TypeID = TypeID;
            vol.Flag = Flag;
            IList<PSP_VolumeBalance> listTypes = Services.BaseService.GetList<PSP_VolumeBalance>("SelectPSP_VolumeBalanceByTypeID", vol);
            FormChooseYears frm = new FormChooseYears();
            foreach (PSP_VolumeBalance year in listTypes)
                frm.ListYearsForChoose.Add(year.Year);

            frm.NoIncreaseRate = true;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                int k = 0;
                PSP_VolumeBalance vb = new PSP_VolumeBalance();
                vb.TypeID = TypeID;
                vb.Flag = Flag;
                IList<PSP_VolumeBalance> pspvb = Services.BaseService.GetList<PSP_VolumeBalance>("SelectPSP_VolumeBalanceByTypeID", vb);
                string str = "";
                PSP_VolumeBalance_Calc vbc = new PSP_VolumeBalance_Calc();
                try
                {
                    vbc.Flag = pspvb[0].UID;
                }
                catch { }
                vbc.Type = "1";
                IList<PSP_VolumeBalance_Calc> vbclist = Services.BaseService.GetList<PSP_VolumeBalance_Calc>("SelectPSP_VolumeBalance_CalcByTypeFlag", vbc);

                DataTable dt = new DataTable();
                //dt.Columns.Add("Sort", typeof(int));
                dt.Columns.Add("序号", typeof(int));
                dt.Columns.Add("项目", typeof(string));

                int isort = 0;
                if (TypeID == "220")
                {
                    foreach (GridColumn i in ctrlPSP_VolumeBalance1.GridView.Columns)
                    {
                        if (i.Caption != "年度" && i.Caption != "小电厂需备用容量" && i.Caption != "外网供电" && i.FieldName != "S2" && i.FieldName != "S3")
                        {
                            if (i.FieldName == "S4")
                                i.Caption = "注:";
                            if (isort == 2)
                            {
                                foreach (PSP_VolumeBalance_Calc pspvbc in vbclist)
                                {
                                    DataRow drow = dt.NewRow();

                                    //drow["序号"] = isort + 1;
                                    drow["项目"] = pspvbc.Title;
                                    dt.Rows.Add(drow);

                                    DataRow drow1 = dt.NewRow();
                                    drow1["项目"] = "注:";
                                    dt.Rows.Add(drow1);
                                }

                                isort++;
                                k = isort + vbclist.Count;
                            }
                            else if (isort == 10)
                            {
                                DataRow drow = dt.NewRow();
                                //drow["序号"] = isort + 1;
                                drow["项目"] = "注:";
                                dt.Rows.Add(drow);
                                isort++;
                            }
                            else if (isort == 12)
                            {
                                DataRow drow = dt.NewRow();
                                //drow["序号"] = isort + 1;
                                drow["项目"] = "注:";
                                dt.Rows.Add(drow);
                                isort++;
                            }
                            DataRow dr = dt.NewRow();
                            //dr["序号"] = isort + 1;
                            dr["项目"] = i.Caption;
                            //dr["Sort"] = isort + 1;
                            dt.Rows.Add(dr);
                            isort++;
                        }
                    }
                }
                if (TypeID == "35")
                {
                    foreach (GridColumn i in ctrlPSP_VolumeBalance1.GridView.Columns)
                    {
                        if (i.Caption != "年度" && i.Caption != "小电厂需备用容量" && i.Caption != "110kV及以下小电源直接供电负荷" && i.FieldName != "S3")
                        {
                            if(i.FieldName== "S2"|| i.FieldName == "S4")
                                i.Caption = "注:";
                            if (isort == 10)
                            {
                                DataRow drow = dt.NewRow();
                                //drow["序号"] = isort + 1;
                                drow["项目"] = "注:";
                                dt.Rows.Add(drow);
                                isort++;
                            }
                            else if (isort == 12)
                            {
                                DataRow drow = dt.NewRow();
                                //drow["序号"] = isort + 1;
                                drow["项目"] = "注:";
                                dt.Rows.Add(drow);
                                isort++;
                            }
                            DataRow dr = dt.NewRow();
                            //dr["序号"] = isort + 1;

                            dr["项目"] = i.Caption;
                            if (dr["项目"]!=null)
                            if (dr["项目"].ToString().Contains("(负荷同时率" + Ensureloadrate() + ")"))
                                 dr["项目"]=dr["项目"].ToString().Replace("(负荷同时率" + Ensureloadrate() + ")", "");
                            //dr["Sort"] = isort + 1;
                            dt.Rows.Add(dr);
                            isort++;
                        }
                    }
                }
                if (TypeID == "110")
                {
                    foreach (GridColumn i in ctrlPSP_VolumeBalance1.GridView.Columns)
                    {
                        if (i.Caption != "年度" && i.Caption != "小电厂需备用容量" )
                        {
                            if (i.FieldName == "S2" || i.FieldName == "S4" || i.FieldName == "S3")
                                i.Caption = "注:";
                            if (isort == 12)
                            {
                                DataRow drow = dt.NewRow();
                                //drow["序号"] = isort + 1;
                                drow["项目"] = "注:";
                                dt.Rows.Add(drow);
                                isort++;
                            }
                            else if (isort == 14)
                            {
                                DataRow drow = dt.NewRow();
                                //drow["序号"] = isort + 1;
                                drow["项目"] = "注:";
                                dt.Rows.Add(drow);
                                isort++;
                            }
                            DataRow dr = dt.NewRow();
                            //dr["序号"] = isort + 1;
                            dr["项目"] = i.Caption;
                            //dr["Sort"] = isort + 1;
                            dt.Rows.Add(dr);
                            isort++;
                        }
                    }
                }
                isort = 1;
                foreach (System.Data.DataRow row in dt.Rows)
                {
                    row["序号"] = isort;
                    isort++;
                }

                foreach (ChoosedYears i in frm.ListChoosedYears)
                {
                    dt.Columns.Add(i.Year + "年", typeof(string));
                }
                //if (TypeID == "220")
                //{
                //    dt.Rows.RemoveAt(vbclist.Count + 14);
                //}
                foreach (ChoosedYears i in frm.ListChoosedYears)
                {

                    foreach (PSP_VolumeBalance balan in pspvb)
                    {
                        if (balan.Year == i.Year)
                        {
                            int j = 0;
                            dt.Rows[0][i.Year + "年"] = balan.L1;
                            dt.Rows[1][i.Year + "年"] = balan.L2;
                            PSP_VolumeBalance_Calc vbcalc = new PSP_VolumeBalance_Calc();
                            vbcalc.Flag = balan.UID;
                            vbcalc.Type = "1";
                            IList<PSP_VolumeBalance_Calc> vbclist1 = Services.BaseService.GetList<PSP_VolumeBalance_Calc>("SelectPSP_VolumeBalance_CalcByTypeFlag", vbcalc);

                            if (TypeID == "220")
                            {

                                foreach (PSP_VolumeBalance_Calc pspvbc in vbclist1)
                                {
                                    dt.Rows[j+2][i.Year + "年"] = pspvbc.Vol.ToString();
                                    j++;
                                    dt.Rows[j + 2][i.Year + "年"] = pspvbc.Col2.ToString();
                                    j++;
                                }
                                dt.Rows[j + 2][i.Year + "年"] = balan.L5;
                                dt.Rows[j + 3][i.Year + "年"] = balan.S4;
                                dt.Rows[j + 4][i.Year + "年"] = balan.L6;
                                dt.Rows[j + 5][i.Year + "年"] = balan.L7;
                                dt.Rows[j + 6][i.Year + "年"] = balan.L8;
                                dt.Rows[j + 7][i.Year + "年"] = balan.L9;
                                dt.Rows[j + 8][i.Year + "年"] = balan.L10;

                                str = "";
                                vbcalc.Type = "2";
                                IList<PSP_VolumeBalance_Calc> vbclist2 = Services.BaseService.GetList<PSP_VolumeBalance_Calc>("SelectPSP_VolumeBalance_CalcByTypeFlag", vbcalc);
                                foreach (PSP_VolumeBalance_Calc pspvbc in vbclist2)
                                {
                                    if (pspvbc.LX1 == "新建")
                                        str += pspvbc.LX1 + "" + pspvbc.Title + "" + pspvbc.LX2;
                                    else
                                        str += pspvbc.Title + "" + pspvbc.LX1 + "" + pspvbc.LX2;
                                    if (pspvbc.UID != vbclist2[vbclist2.Count - 1].UID)
                                        str += ",";

                                }
                                dt.Rows[j + 9][i.Year + "年"] = str;
                                dt.Rows[j + 10][i.Year + "年"] = balan.L11;
                                str = "";
                                vbcalc.Type = "3";
                                IList<PSP_VolumeBalance_Calc> vbclist3 = Services.BaseService.GetList<PSP_VolumeBalance_Calc>("SelectPSP_VolumeBalance_CalcByTypeFlag", vbcalc);
                                foreach (PSP_VolumeBalance_Calc pspvbc in vbclist3)
                                {
                                    if (pspvbc.LX1 == "新建")
                                        str += pspvbc.LX1 + "" + pspvbc.Title + "" + pspvbc.LX2;
                                    else
                                        str += pspvbc.Title + "" + pspvbc.LX1 + "" + pspvbc.LX2;
                                    if (pspvbc.UID != vbclist3[vbclist3.Count - 1].UID)
                                        str += ",";
                                }
                                dt.Rows[j + 11][i.Year + "年"] = str;
                                dt.Rows[j + 12][i.Year + "年"] = balan.L12;
                                dt.Rows[j + 13][i.Year + "年"] = balan.L13;
                                dt.Rows[j + 14][i.Year + "年"] = balan.L14;
                            }
                            else if (TypeID == "110")
                            {
                                //foreach (PSP_VolumeBalance_Calc pspvbc in vbclist1)
                                //{
                                //    str = "(" + pspvbc.Title + "," + pspvbc.LX1 + "," + pspvbc.LX2 + ")  " + str;
                                //}
                                dt.Rows[2][i.Year + "年"] = balan.S2;

                                dt.Rows[j + 3][i.Year + "年"] = balan.L4;
                                dt.Rows[j + 4][i.Year + "年"] = balan.S3;
                                dt.Rows[j + 5][i.Year + "年"] = balan.L5;
                                dt.Rows[j + 6][i.Year + "年"] = balan.S4;
                                dt.Rows[j + 7][i.Year + "年"] = balan.L6;
                                dt.Rows[j + 8][i.Year + "年"] = balan.L7;
                                dt.Rows[j + 9][i.Year + "年"] = balan.L8;
                                dt.Rows[j + 10][i.Year + "年"] = balan.L9;
                                dt.Rows[j + 11][i.Year + "年"] = balan.L10;

                                str = "";
                                vbcalc.Type = "2";
                                IList<PSP_VolumeBalance_Calc> vbclist2 = Services.BaseService.GetList<PSP_VolumeBalance_Calc>("SelectPSP_VolumeBalance_CalcByTypeFlag", vbcalc);
                                foreach (PSP_VolumeBalance_Calc pspvbc in vbclist2)
                                {
                                    if (pspvbc.LX1 == "新建")
                                        str += pspvbc.LX1 + "" + pspvbc.Title + "" + pspvbc.LX2;
                                    else
                                        str += pspvbc.Title + "" + pspvbc.LX1 + "" + pspvbc.LX2;
                                    if (pspvbc.UID != vbclist2[vbclist2.Count - 1].UID)
                                        str += ",";

                                }
                                dt.Rows[j + 12][i.Year + "年"] = str;
                                dt.Rows[j + 13][i.Year + "年"] = balan.L11;

                                str = "";
                                vbcalc.Type = "3";
                                IList<PSP_VolumeBalance_Calc> vbclist3 = Services.BaseService.GetList<PSP_VolumeBalance_Calc>("SelectPSP_VolumeBalance_CalcByTypeFlag", vbcalc);
                                foreach (PSP_VolumeBalance_Calc pspvbc in vbclist3)
                                {
                                    if (pspvbc.LX1 == "新建")
                                        str += pspvbc.LX1 + "" + pspvbc.Title + "" + pspvbc.LX2;
                                    else
                                        str += pspvbc.Title + "" + pspvbc.LX1 + "" + pspvbc.LX2;
                                    if (pspvbc.UID != vbclist3[vbclist3.Count - 1].UID)
                                        str += ",";
                                }
                                dt.Rows[j + 14][i.Year + "年"] = str;
                                dt.Rows[j + 15][i.Year + "年"] = balan.L12;
                                dt.Rows[j + 16][i.Year + "年"] = balan.L13;
                                dt.Rows[j + 17][i.Year + "年"] = balan.L14;
                            }
                            else if (TypeID == "35")
                            {
                                dt.Rows[j+2][i.Year + "年"] = balan.S2;
                                dt.Rows[j + 3][i.Year + "年"] = balan.L5;
                                dt.Rows[j + 4][i.Year + "年"] = balan.S4;
                                dt.Rows[j + 5][i.Year + "年"] = balan.L6;
                                dt.Rows[j + 6][i.Year + "年"] = balan.L7;
                                dt.Rows[j + 7][i.Year + "年"] = balan.L8;
                                dt.Rows[j + 8][i.Year + "年"] = balan.L9;
                                dt.Rows[j + 9][i.Year + "年"] = balan.L10;
                                //dt.Rows[j + 8][i.Year + "年"] = balan.L10;
                                str = "";
                                vbcalc.Type = "2";
                                IList<PSP_VolumeBalance_Calc> vbclist2 = Services.BaseService.GetList<PSP_VolumeBalance_Calc>("SelectPSP_VolumeBalance_CalcByTypeFlag", vbcalc);
                                foreach (PSP_VolumeBalance_Calc pspvbc in vbclist2)
                                {
                                    if (pspvbc.LX1 == "新建")
                                        str += pspvbc.LX1 + "" + pspvbc.Title + "" + pspvbc.LX2;
                                    else
                                        str += pspvbc.Title + "" + pspvbc.LX1 + "" + pspvbc.LX2;
                                    if (pspvbc.UID != vbclist2[vbclist2.Count - 1].UID)
                                        str += ",";

                                }
                                dt.Rows[j + 10][i.Year + "年"] = str;
                                dt.Rows[j + 11][i.Year + "年"] = balan.L11;
                                str = "";
                                vbcalc.Type = "3";
                                IList<PSP_VolumeBalance_Calc> vbclist3 = Services.BaseService.GetList<PSP_VolumeBalance_Calc>("SelectPSP_VolumeBalance_CalcByTypeFlag", vbcalc);
                                foreach (PSP_VolumeBalance_Calc pspvbc in vbclist3)
                                {
                                    if (pspvbc.LX1 == "新建")
                                        str += pspvbc.LX1 + "" + pspvbc.Title + "" + pspvbc.LX2;
                                    else
                                        str += pspvbc.Title + "" + pspvbc.LX1 + "" + pspvbc.LX2;
                                    if (pspvbc.UID != vbclist3[vbclist3.Count - 1].UID)
                                        str += ",";
                                }
                                dt.Rows[j + 12][i.Year + "年"] = str;
                                dt.Rows[j + 13][i.Year + "年"] = balan.L12;
                                dt.Rows[j + 14][i.Year + "年"] = balan.L13;

                            }
                        }
                    }

                }

                FormPSP_VolumeBalance_Print fr = new FormPSP_VolumeBalance_Print();
                fr.GridDataTable = dt;
                //if (TypeID == "220")
                //{
                    fr.Text = this.Text;
                    fr.gridView1.GroupPanelText = this.Text;
                    fr.PRintRight = PrintRight;
                //}
                fr.ShowDialog();
            }
        }
        //统计
        private void barButtonItem6_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            FormChooseYears frm = new FormChooseYears();
            foreach (TreeListColumn column in treeList1.Columns)
            {
                if (column.FieldName.IndexOf("年") > 0)
                {
                    frm.ListYearsForChoose.Add((int)column.Tag);
                }
            }
            frm.NoIncreaseRate = true;
            DataTable dt = new DataTable();
            PSP_Types psp_Type = new PSP_Types();
            psp_Type.Flag2 = typeFlag2;
            IList listTypes = Common.Services.BaseService.GetList("SelectPSP_TypesByFlag2", psp_Type);
            dt = Itop.Common.DataConverter.ToDataTable(listTypes, typeof(PSP_Types));
            PSP_Years psp_Year = new PSP_Years();
            psp_Year.Flag = typeFlag2;
            IList<PSP_Years> listYears = Common.Services.BaseService.GetList<PSP_Years>("SelectPSP_YearsListByFlag", psp_Year);

            foreach (PSP_Years item in listYears)
            {
                dt.Columns.Add(item.Year + "年", typeof(double));
            }
            PSP_Values psp_Values = new PSP_Values();
            psp_Values.ID = typeFlag2;//用ID字段存放Flag2的值

            IList<PSP_Values> listValues = Common.Services.BaseService.GetList<PSP_Values>("SelectPSP_ValuesListByFlag2", psp_Values);
            foreach (PSP_Values psptemp in listValues)
            {
                foreach (DataRow dttemp in dt.Rows)
                {
                    if (Convert.ToInt32(dttemp["ID"].ToString()) == psptemp.TypeID)
                        dttemp[psptemp.Year + "年"] = psptemp.Value;
                }
            }
            if(frm.ShowDialog() == DialogResult.OK)
            {

                FrmBalanceOfPowerRegionPrint frma = new FrmBalanceOfPowerRegionPrint();
                frma.IsSelect = _isSelect;
                frma.HASH = hash;
                frma.HASH2 = hash2;
                frma.Text = "南北区电力平衡表";

                frma.GridDataTable = ResultDataTable(dt, frm.ListChoosedYears);
                frma.ISPrint = PrintRight;
                if (frma.ShowDialog() == DialogResult.OK && _isSelect)
                {

                    DialogResult = DialogResult.OK;
                }

            }
        }