Пример #1
0
        public void Build_Sheet(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            //���8 ��6 ��
            rowcount = 8;
            colcount = 6;
            //�������һ�еı���
            title = TC.GetTableTitle(this.GetType().Name);
            //����������
            //int[] TableYearsAry = TC.GetTableYears(this.GetType().Name);
            //��������
            sheetname = title;
            //�趨����������ֵ������ͱ���
            TC.Sheet_RowCol_Title_Name(obj_sheet, rowcount, colcount, title, sheetname);
            //�趨����ģʽ���Ա�д��ʽʹ��
            TC.Sheet_Referen_R1C1(obj_sheet);
            //�趨����п��
            obj_sheet.Columns[0].Width = 60;
            obj_sheet.Columns[1].Width = 100;
            obj_sheet.Columns[2].Width = 100;
            obj_sheet.Columns[3].Width = 80;
            obj_sheet.Columns[4].Width = 100;
            obj_sheet.Columns[5].Width = 80;
            //�趨����и߶�
            obj_sheet.Rows[0].Height = 20;
            obj_sheet.Rows[1].Height = 20;
            obj_sheet.Rows[2].Height = 20;
            //���������

            //2�������
            obj_sheet.AddSpanCell(1, 0, 2, 1);
            obj_sheet.AddSpanCell(1, 1, 2, 1);
            obj_sheet.SetValue(1, 2, "������");
            obj_sheet.AddSpanCell(1, 3, 2, 1);
            obj_sheet.SetValue(1, 3, "�����ʣ�%��");
            obj_sheet.SetValue(1, 4, "���縺��");
            obj_sheet.AddSpanCell(1, 5, 2, 1);
            obj_sheet.SetValue(1, 5, "�����ʣ�%��");

            //3�������
            obj_sheet.SetValue(2, 2, "����ǧ��ʱ��");
            obj_sheet.SetValue(2, 4, "����ǧ�ߣ�");
            //���������

            //1�������
            obj_sheet.SetValue(3, 0, "1");

            //2�������
            obj_sheet.SetValue(3, 1, "ȫ��");

            //�������
            Sheet_AddData(obj_sheet);

            //�趨�����
            TC.Sheet_GridandCenter(obj_sheet);

            //�������
            TC.Sheet_Locked(obj_sheet);
        }
Пример #2
0
        //////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// 填写表头
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="Title"></param>
        public void SetSheet_13Title(Itop.Client.Base.FormBase FB, FarPoint.Win.Spread.SheetView obj, string Title)
        {
            int IntColCount = 3;
            int IntRowCount = 6 + 2 + 3;//标题占3行,分区类型占2行
            string title = null;

            obj.SheetName = Title;
            obj.Columns.Count = IntColCount;
            obj.Rows.Count = IntRowCount;
            IntCol = obj.Columns.Count;

            PF.Sheet_GridandCenter(obj);//画边线,居中
            m_PF.LockSheets(obj);

            string strTitle = "";
            IntRow = 3;
            strTitle = Title;
            PF.CreateSheetView(obj, IntRow, IntCol, 0, 0, Title);
            PF.SetSheetViewColumnsWidth(obj, 0, Title);
            IntCol = 1;

            strTitle = "单位:万千瓦 万千伏安 千伏 座 台";
            obj.AddSpanCell(IntRow, 0, 1, obj.Columns.Count);
            obj.SetValue(IntRow, 0, strTitle);
            PF.SetSheetViewColumnsWidth(obj, 0, strTitle);
            //右对齐
            obj.Rows[IntRow].HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Right;
            //列标题
            strTitle = "序号";
            PF.CreateSheetView(obj, NextRowMerge += 1, NextColMerge, IntRow += 1, IntCol -= 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            for (int i = 0; i < (IntColCount - 1); ++i)
            {
                switch (i)
                {
                    case 0:
                        strTitle = " 项                目   ";
                        break;
                    case 1:
                        strTitle = " 统计   ";
                        break;
                     default:
                        break;
                }
                PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
                PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);
            }

            NextRowMerge = 1;
            NextColMerge = 1;

            IntRow = 5;
            IntCol = 0;
            //PF.SetWholeRowHeight(obj, obj.Rows.Count, obj.Columns.Count);//行高
        }
Пример #3
0
        private void AddItemsCol(FarPoint.Win.Spread.SheetView obj_sheet, int[] TableYearsAry)
        {
            //int[] TableYearsAry = TC.GetTableYears(this.GetType().Name);
            for (int i = 0; i < TableYearsAry.Length; i++)
            {
                obj_sheet.SetValue(2, 6+i,TableYearsAry[i]);
            }

            obj_sheet.AddSpanCell(1, 6, 1, TableYearsAry.Length);
            obj_sheet.SetValue(1, 6, "Ͷ����ݺ�Ͷ����ģ");
        }
Пример #4
0
        private void Sheet_AddItem(FarPoint.Win.Spread.SheetView obj_sheet,Hashtable area_key_id, IList<string> obj_DY_List, IList<string> SXareaid_List, IList<string> XJareaid_List)
        {
            //写标题行内容

            //2行标题内容
            obj_sheet.SetValue(1, 0, "分区类型");
            obj_sheet.SetValue(1, 1, "分区名称");
            obj_sheet.SetValue(1, 2, "低压线路类型");
            obj_sheet.SetValue(1, 3, "导线截面(mm2)");
            //写标题列内容
            int dylength = obj_DY_List.Count;

            int startrow = 2;
            for (int i = 0; i < (2 + SXareaid_List.Count + XJareaid_List.Count); i++)
            {
                string areaname = "";
                if (i == 0 || i == (SXareaid_List.Count + 1))
                {
                    areaname = "合计";
                }
                else
                {
                    if (i < SXareaid_List.Count + 1)
                    {
                        if (area_key_id[SXareaid_List[i - 1].ToString()] != null)
                        {
                            areaname = area_key_id[SXareaid_List[i - 1].ToString()].ToString();
                        }
                        else
                        {
                            areaname = "";
                        }

                    }
                    else
                    {
                        if (area_key_id[XJareaid_List[i - SXareaid_List.Count - 2].ToString()] != null)
                        {
                            areaname = area_key_id[XJareaid_List[i - SXareaid_List.Count - 2].ToString()].ToString();
                        }
                        else
                        {
                            areaname = "";
                        }
                    }
                }
                for (int j = 0; j < obj_DY_List.Count; j++)
                {
                    obj_sheet.SetValue(startrow + i * dylength + j, 2, obj_DY_List[j].ToString());
                }
                obj_sheet.AddSpanCell(startrow + i * dylength, 1, dylength, 1);
                obj_sheet.SetValue(startrow + i * dylength, 1, areaname);

            }
            //写第一列数据
            obj_sheet.AddSpanCell(startrow, 0, (SXareaid_List.Count + 1)*dylength, 1);
            obj_sheet.SetValue(startrow, 0, "市辖供电区");
            obj_sheet.AddSpanCell(startrow + (SXareaid_List.Count + 1) * dylength, 0, (XJareaid_List.Count + 1) * dylength, 1);
            obj_sheet.SetValue(startrow + (SXareaid_List.Count + 1) * dylength, 0, "县级供电区");
        }
Пример #5
0
        //�˴�Ϊ��̬������ݷ���
        private void Sheet_AddData(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            int startrow = 2;
            int addnum = 0;
            int itemcount = 0;
            int firstrow = 0;
            ArrayList rowsum = new ArrayList();
            Itop.Domain.PWTable.PW_tb3a p = new Itop.Domain.PWTable.PW_tb3a();
            p.col2 = Itop.Client.MIS.ProgUID;
            IList<PW_tb3a> alist = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aListDIS", p);

            for (int n = 0; n < alist.Count; n++)
            {
                for (int m = 0; m < 8; m++)
                {
                    obj_sheet.RowCount = obj_sheet.RowCount + 1;
                }

                obj_sheet.AddSpanCell(2, 0, 8, 1);
                obj_sheet.SetValue(2, 0, "XX�����أ�");

                //2�������
                obj_sheet.AddSpanCell(startrow+n * 8, 1, 6, 1);
                obj_sheet.SetValue(startrow + n * 8, 1, "���ͽ��ߣ��أ�");
                obj_sheet.AddSpanCell(startrow + (n + 1) * 8-1, 1, 1, 2);
                obj_sheet.SetValue(startrow + (n + 1) * 8-1, 1, "������");
                obj_sheet.AddSpanCell(startrow + (n + 1) * 8, 1, 1, 2);
                obj_sheet.SetValue(startrow + (n+1) * 8, 1, "�����ǵ��ͽ��ߣ��أ�");

                //3�������
                obj_sheet.SetValue(startrow + n * 8, 2, "����һ��");
                obj_sheet.SetValue(startrow + n * 8+1, 2, "����һ��");
                obj_sheet.SetValue(startrow + n * 8 + 2, 2, "������");
                obj_sheet.SetValue(startrow + n * 8 + 3, 2, "˫����");
                obj_sheet.SetValue(startrow + n * 8 + 4, 2, "��ֶ�������");
                obj_sheet.SetValue(startrow + n * 8 + 5, 2, "��ֶ�������");

                PW_tb3a _tba = alist[n];
                p.PQName = _tba.PQName;
                p.JXMS = "����һ��";
                IList<PW_tb3a> list1 = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "����һ��";
                IList<PW_tb3a> list2 = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "������";
                IList<PW_tb3a> list3 = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "˫����";
                IList<PW_tb3a> list4 = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "��ֶ�������";
                IList<PW_tb3a> list5 = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "��ֶ�������";
                IList<PW_tb3a> list6 = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "������";
                IList<PW_tb3a> list7 = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "�����ǵ��ͽ���";
                IList<PW_tb3a> list8 = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2255", p);
                if (list1.Count > 0)
                {
                    PW_tb3a obj = list1[0];
                    obj_sheet.SetValue(n+startrow+n*7, 0, obj.PQName);
                    obj_sheet.SetValue(n+startrow+n*7, 3, obj.Num1);
                    obj_sheet.SetValue(n+startrow+n*7, 4, obj.Num2);
                    obj_sheet.SetValue(n+startrow+n*7, 5, obj.Num3);
                    obj_sheet.SetValue(n+startrow+n*7, 6, obj.Num4);
                    obj_sheet.SetValue(n+startrow+n*7, 7, obj.Num5);
                    obj_sheet.SetValue(n+startrow+n*7, 8, obj.Num6);
                    obj_sheet.SetValue(n+startrow+n*7, 9, obj.Num7);
                    obj_sheet.SetValue(n+startrow+n*7, 10, obj.Num8);
                }
                else
                {
                    TC.Sheet_WriteZero(obj_sheet, n + startrow+n*7,3,1,8);
                }
            }
        }
Пример #6
0
        private void Sheet_AddItem(FarPoint.Win.Spread.SheetView obj_sheet, List<string[]> SxXjName, IList<string> obj_DY_List)
        {
            //写标题行内容

            //2行标题内容
            obj_sheet.SetValue(1, 0, "编号");
            obj_sheet.SetValue(1, 1, "类型");
            obj_sheet.SetValue(1, 2, "低压线路类型");
            obj_sheet.SetValue(1, 3, "导线截面(mm2)");
            //写标题列内容

            int startrow = 2;
            //添加列标题内容
            int dylength = obj_DY_List.Count;
            if (obj_DY_List.Count > 0)
            {
                for (int i = 0; i < SxXjName.Count; i++)
                {
                    for (int j = 0; j < obj_DY_List.Count; j++)
                    {
                        obj_sheet.SetValue(startrow + i * dylength + j, 2, obj_DY_List[j].ToString());
                    }
                    obj_sheet.AddSpanCell(startrow + i * dylength, 0, dylength, 1);
                    obj_sheet.SetValue(startrow + i * dylength, 0, SxXjName[i][0].ToString());
                    obj_sheet.AddSpanCell(startrow + i * dylength, 1, dylength, 1);
                    obj_sheet.SetValue(startrow + i * dylength, 1, SxXjName[i][1].ToString());
                }
            }
        }
Пример #7
0
        /// <summary>
        /// 重绘
        /// </summary>
        /// <param name="obj"></param>
        private void Redraw(Itop.Client.Base.FormBase FB, FarPoint.Win.Spread.SheetView obj, int BeginYear, int EndYear)
        {
            list = AddColumnTitle(BeginYear, EndYear);
            obj.RowCount = 0;
            obj.ColumnCount = 0;
            obj.ColumnCount = 1 + (EndYear - BeginYear + 1) + list.Count+1;

            SelectDQ(FB);
            int IntRowCount = 1+AreaList.Count + 1 + 2 + 3;//标题占3行,分区类型占2行,1是其它用
            string title = null;

            obj.Rows.Count = IntRowCount;
            IntCol = obj.Columns.Count;

            PF.Sheet_GridandCenter(obj);//画边线,居中
            m_PF.LockSheets(obj);

            string strTitle = "";
            IntRow = 3;
            strTitle = "附表2 铜陵县分镇/片区" + BeginYear + "~" + EndYear + "年人口状况表";
            PF.CreateSheetView(obj, IntRow, IntCol, 0, 0, strTitle);
            PF.SetSheetViewColumnsWidth(obj, 0, strTitle);
            IntCol = 1;

            strTitle = "单位:万人、平方公里";
            obj.AddSpanCell(IntRow, 0, 1, obj.Columns.Count);
            obj.SetValue(IntRow, 0, strTitle);
            //右对齐
            obj.Rows[IntRow].HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Right;

            strTitle = " 镇/片区";
            PF.CreateSheetView(obj, NextRowMerge += 1, NextColMerge, IntRow += 1, IntCol -= 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            strTitle = "面积";
            PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, "60");
            for (int i = 0; i < AreaList.Count+1; ++i)
            {
                if(i!=AreaList.Count)
                {
                    PF.CreateSheetView(obj, 1, NextColMerge, (IntRow + i + 2), 0, AreaList[i].ToString());
                    PF.SetSheetViewColumnsWidth(obj, IntCol, AreaList[i].ToString());
                }
                else
                {
                    PF.CreateSheetView(obj, 1, NextColMerge, (IntRow + i + 2), 0, "合计");
                }
            }

            NextRowMerge = 1;
            NextColMerge = 1;

            IntRow = 5;
            IntCol = 0;
            //PF.SetWholeRowHeight(obj, obj.Rows.Count, obj.Columns.Count);//行高
        }
Пример #8
0
        private void Sheet_AddItem(FarPoint.Win.Spread.SheetView obj_sheet, IList<string> SXareaid_List, IList<string> XJareaid_List)
        {
            //写标题行内容

            //2行标题内容
            obj_sheet.AddSpanCell(1, 0, 2, 1);
            obj_sheet.SetValue(1, 0, "分区类型");
            obj_sheet.AddSpanCell(1, 1, 2, 1);
            obj_sheet.SetValue(1, 1, "分区名称");
            obj_sheet.AddSpanCell(1, 2, 2, 1);
            obj_sheet.SetValue(1, 2, "电压等级");
            obj_sheet.AddSpanCell(1, 3, 2, 1);
            obj_sheet.SetValue(1, 3, "建设型式");
            obj_sheet.AddSpanCell(1, 4, 2, 1);
            obj_sheet.SetValue(1, 4, "平均用地需求");
            obj_sheet.AddSpanCell(1, 5, 1, 2);
            obj_sheet.SetValue(1, 5, "2010年");
            obj_sheet.AddSpanCell(1, 7, 1, 2);
            obj_sheet.SetValue(1, 7, "2011年");
            obj_sheet.AddSpanCell(1, 9, 1, 2);
            obj_sheet.SetValue(1, 9, "2012年");
            obj_sheet.AddSpanCell(1, 11, 1, 2);
            obj_sheet.SetValue(1, 11, "2013年");
            obj_sheet.AddSpanCell(1, 13, 1, 2);
            obj_sheet.SetValue(1, 13, "2014年");
            obj_sheet.AddSpanCell(1, 15, 1, 2);
            obj_sheet.SetValue(1, 15, "2015年");
            obj_sheet.AddSpanCell(1, 17, 1, 2);
            obj_sheet.SetValue(1, 17, "“十二五”合计");

            //3行标题内容
            obj_sheet.SetValue(2, 5, "座数");
            obj_sheet.SetValue(2, 6, "用地需求");
            obj_sheet.SetValue(2, 7, "座数");
            obj_sheet.SetValue(2, 8, "用地需求");
            obj_sheet.SetValue(2, 9, "座数");
            obj_sheet.SetValue(2, 10, "用地需求");
            obj_sheet.SetValue(2, 11, "座数");
            obj_sheet.SetValue(2, 12, "用地需求");
            obj_sheet.SetValue(2, 13, "座数");
            obj_sheet.SetValue(2, 14, "用地需求");
            obj_sheet.SetValue(2, 15, "座数");
            obj_sheet.SetValue(2, 16, "用地需求");
            obj_sheet.SetValue(2, 17, "座数");
            obj_sheet.SetValue(2, 18, "用地需求");
            //写标题列内容

            //4列标题内容
            obj_sheet.SetValue(3, 3, "户外");
            obj_sheet.SetValue(4, 3, "半户内");
            obj_sheet.SetValue(5, 3, "户内");
            obj_sheet.SetValue(6, 3, "其它");
            //写标题列内容
            List<string> obj_DY_List = new List<string>();
            obj_DY_List.Add("110(66)");
            obj_DY_List.Add("35");

            int startrow = 3;
            int dylength = obj_DY_List.Count;
            int length = 4;

            if (obj_DY_List.Count > 0)
            {
                for (int i = 0; i < (2 + SXareaid_List.Count + XJareaid_List.Count); i++)
                {
                    string areaname = "";
                    if (i == 0 || i == (SXareaid_List.Count + 1))
                    {
                        areaname = "合计";
                    }
                    else
                    {
                        if (i < SXareaid_List.Count + 1)
                        {
                            areaname = SXareaid_List[i - 1].ToString();
                        }
                        else
                        {
                            areaname = XJareaid_List[i - SXareaid_List.Count - 2].ToString();
                        }
                    }
                    for (int j = 0; j < obj_DY_List.Count; j++)
                    {
                        int row = startrow + i * dylength * length + j * length;
                        obj_sheet.SetValue(row, 3, "户外");
                        obj_sheet.SetValue(row + 1, 3, "半户内");
                        obj_sheet.SetValue(row + 2, 3, "户内");
                        obj_sheet.SetValue(row + 3, 3, "其它");
                        obj_sheet.AddSpanCell(startrow + i * dylength * length + j * length, 2, length, 1);
                        obj_sheet.SetValue(startrow + i * dylength * length + j * length, 2, obj_DY_List[j].ToString());
                    }
                    obj_sheet.AddSpanCell(startrow + i * dylength * length, 1, dylength * length, 1);
                    obj_sheet.SetValue(startrow + i * dylength * length, 1, areaname);

                }
                //写第一列数据
                obj_sheet.AddSpanCell(startrow, 0, (SXareaid_List.Count + 1) * dylength * length, 1);
                obj_sheet.SetValue(startrow, 0, "市辖供电区");
                obj_sheet.AddSpanCell(startrow + (SXareaid_List.Count + 1) * dylength * length, 0, (XJareaid_List.Count + 1) * dylength * length, 1);
                obj_sheet.SetValue(startrow + (SXareaid_List.Count + 1) * dylength * length, 0, "县级供电区");
            }
        }
Пример #9
0
        //�˴�Ϊ��̬������ݷ���
        private void Sheet_AddData(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            int startrow = 3;
            int addnum = 0;
            int itemcount = 0;
            int firstrow = 0;
            string rowsum = "";
            string rowsum2 = "";
            Itop.Domain.PWTable.PW_tb3a p = new Itop.Domain.PWTable.PW_tb3a();
            p.col2 = Itop.Client.MIS.ProgUID;
            IList<PW_tb3a> list = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2254", p);

            bool sheetEnd = false;
            for (int i = 0; i < list.Count;i++ )
            {

                PW_tb3a obj = list[i];
                PW_tb3a obj2 = new PW_tb3a();
                if (i < list.Count - 1)
                {
                    obj2 = list[i + 1];
                }
                else
                {
                    sheetEnd = true;
                }
                decimal _sum = obj.Num1 + obj.Num2 + obj.Num3 + obj.Num4 + obj.Num5 + obj.Num6 + obj.Num7 + obj.Num8;
                itemcount = itemcount + 1;
                obj_sheet.RowCount = obj_sheet.RowCount + 1;
                obj_sheet.SetValue(i + addnum + startrow, 0, obj.PQName);
                obj_sheet.SetValue(i + addnum + startrow, 1, "��·�������أ�");
                obj_sheet.SetValue(i + addnum + startrow, 2, obj.Num1);
                obj_sheet.SetValue(i + addnum + startrow, 3, obj.Num2);
                obj_sheet.SetValue(i + addnum + startrow, 4, obj.Num3);
                obj_sheet.SetValue(i + addnum + startrow, 5, obj.Num4);
                obj_sheet.SetValue(i + addnum + startrow, 6, obj.Num5);
                obj_sheet.SetValue(i + addnum + startrow, 7, obj.Num6);
                obj_sheet.SetValue(i + addnum + startrow, 8, obj.Num7);
                obj_sheet.SetValue(i + addnum + startrow, 9, obj.Num8);
                obj_sheet.SetValue(i + addnum + startrow, 10, _sum);

                itemcount = itemcount + 1;
                addnum = addnum + 1;
                obj_sheet.RowCount = obj_sheet.RowCount + 1;
                obj_sheet.SetValue(i + addnum + startrow, 0, obj.PQName);
                obj_sheet.SetValue(i + addnum + startrow, 1, "��ռ������%��");
                if (_sum == 0)
                {
                    obj_sheet.SetValue(i + addnum + startrow, 2, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 3, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 4, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 5, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 6, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 7, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 8, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 9, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 10, "0");
                }
                else
                {
                    obj_sheet.SetValue(i + addnum + startrow, 2, Convert.ToDecimal((obj.Num1 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 3, Convert.ToDecimal((obj.Num2 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 4, Convert.ToDecimal((obj.Num3 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 5, Convert.ToDecimal((obj.Num4 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 6, Convert.ToDecimal((obj.Num5 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 7, Convert.ToDecimal((obj.Num6 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 8, Convert.ToDecimal((obj.Num7 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 9, Convert.ToDecimal((obj.Num8 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 10, "100");
                }
                obj_sheet.AddSpanCell(i + addnum + startrow-1, 0, 2, 1);

                rowsum = rowsum + Convert.ToString(startrow-2+2*(i+1)) + ",";
                rowsum2 = rowsum2 + Convert.ToString(startrow - 1 + 2 * (i + 1)) + ",";
                if (sheetEnd)
                {
                    addnum = addnum + 1;
                    obj_sheet.RowCount = obj_sheet.RowCount + 1;
                    obj_sheet.SetValue(i + addnum + startrow, 0, "ȫ�кϼ�");
                    obj_sheet.SetValue(i + addnum + startrow, 1, "��·�������أ�");
                    TC.Sheet_WriteFormula_RowSum3(obj_sheet, TC.getRowList(rowsum), 2, i + addnum + startrow, 2, 9);
                    addnum = addnum + 1;
                    obj_sheet.RowCount = obj_sheet.RowCount + 1;
                    obj_sheet.SetValue(i + addnum + startrow, 0, "ȫ�кϼ�");
                    obj_sheet.SetValue(i + addnum + startrow, 1, "��ռ������%��");
                    //TC.Sheet_WriteFormula_TwoCol_Percent(obj_sheet, i + addnum + startrow - 1, 2, 7, 1, i + addnum + startrow, 2);
                    obj_sheet.SetValue(i + addnum + startrow, 10, "100");
                    obj_sheet.AddSpanCell(i + addnum + startrow-1, 0, 2, 1);
                }
            }
        }
Пример #10
0
        /// <summary>
        /// 写入数据
        /// </summary>
        /// <param name="FB"></param>
        /// <param name="obj"></param>
        /// <param name="IntRow"></param>
        private void WriteData(Itop.Client.Base.FormBase FB, FarPoint.Win.Spread.SheetView obj,int IntRow)
        {
            PSP_Substation_Info ppi = null;
            InitStruct();
            int index = 0;
            int indexCount = 0;
            int JH = 0;
            int inttemp = 0;
            string[] LRData = new string[2];//0,为*号左侧数据,1为*号右侧数据

            for (int i = IntRow; i < obj.RowCount; i += indexCount)
            {
                ppi = (PSP_Substation_Info)BDZList[index];
                if (ppi.L3 > 0)
                    indexCount = ppi.L3;
                else
                    indexCount = 1;
                for (int j = 0; j < obj.ColumnCount; ++j)
                {
                    switch (j)
                    {
                        case 0://变电站名称

                            obj.AddSpanCell((i), j, indexCount, 1);
                            obj.SetValue((i), j, ppi.Title);
                            index ++;
                            break;
                        case 1://主变容量
                            if(ppi.L4!="")
                            {
                                JH = ReturnJH(ppi.L4);//得到加号的数量

                                intercept.JHData = new string[ppi.L3];
                                ReturnJHOfData(ppi.L4);
                                for (int o = 0; o < ppi.L3; ++o)
                                {
                                    for (int n = 0; n < JH; ++n)
                                    {
                                        LRData = ReturnCHOfData(intercept.JHData[n]);
                                        obj.SetValue((i + n), j, LRData[1]);
                                    }
                                    if (JH < ppi.L3)
                                    {
                                        LRData = ReturnCHOfData(intercept.JHData[0]);
                                        obj.SetValue((i + o), j, LRData[1]);
                                    }
                                }
                                intercept.index = 0;
                            }

                            break;
                        case 2://10kV线路所带负荷

                            obj.AddSpanCell((i), j, indexCount, 1);
                            obj.Cells[i, j].Locked = false;
                            break;
                        case 3://需转供负荷
                            obj.AddSpanCell((i), j, indexCount, 1);
                            obj.Cells[i, j].Formula = "C" + (i + 1) + "-B" + (i + 1);
                            break;
                        case 4://联络的变电站
                            obj.AddSpanCell((i), j, indexCount, 1);
                            obj.Cells[i, j].Locked = false;
                            break;
                        case 5://联络线路条数
                            obj.AddSpanCell((i), j, indexCount, 1);
                            obj.Cells[i, j].Locked = false;
                            break;
                        case 6://联络线路能转带的负荷
                            obj.AddSpanCell((i), j, indexCount, 1);
                            obj.Cells[i, j].Locked = false;
                            break;
                        case 7://联络变电站能转带的负荷

                            obj.AddSpanCell((i), j, indexCount, 1);
                            obj.Cells[i, j].Locked = false;
                            break;
                        case 8://通过联络可转带的负荷
                            obj.AddSpanCell((i), j, indexCount, 1);
                            obj.Cells[i, j].Locked = false;
                            break;
                        case 9://通过主变能转带负荷

                            obj.AddSpanCell((i), j, indexCount, 1);
                            obj.Cells[i, j].Locked = false;
                            break;
                        case 10://需通过10kV网络转带负荷
                            obj.AddSpanCell((i), j, indexCount, 1);
                            obj.Cells[i, j].Locked = false;
                            break;
                        case 11://是否通过
                            obj.AddSpanCell((i), j, indexCount, 1);
                            obj.SetValue(i, j, ppi.S1);
                            break;

                        default:
                            break;
                    }
                }
            }
        }
Пример #11
0
        //////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// 填写表头
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="Title"></param>
        public void SetSheet_11Title(Itop.Client.Base.FormBase FB, FarPoint.Win.Spread.SheetView obj, string Title)
        {
            int IntColCount = 8;
            SelectedBDZ(FB);
            int IntRowCount =list.Count+1 + 2 + 3;//标题占3行,分区类型占2行
            string title = null;

            obj.SheetName = Title;
            obj.Columns.Count = IntColCount;
            obj.Rows.Count = IntRowCount;
            IntCol = obj.Columns.Count;

            PF.Sheet_GridandCenter(obj);//画边线,居中
            m_PF.LockSheets(obj);

            string strTitle = "";
            IntRow = 3;
            strTitle = Title;
            PF.CreateSheetView(obj, IntRow, IntCol, 0, 0, Title);
            PF.SetSheetViewColumnsWidth(obj, 0, Title);
            IntCol = 1;

            strTitle = "单位:万千瓦";
            obj.AddSpanCell(IntRow, 0, 1, obj.Columns.Count);
            obj.SetValue(IntRow, 0, strTitle);
            PF.SetSheetViewColumnsWidth(obj, 0, strTitle);
            //右对齐
            obj.Rows[IntRow].HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Right;
            //列标题
            strTitle = "  序     号  ";
            PF.CreateSheetView(obj, NextRowMerge += 1, NextColMerge, IntRow += 1, IntCol -= 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            for (int i = 0; i < (IntColCount - 1); ++i)
            {
                switch (i)
                {
                    case 0:
                        strTitle = " 变电站   ";
                        break;
                    case 1:
                        strTitle = " 该站所带最大负荷   ";
                        break;
                    case 2:
                        strTitle = "  主变容量  ";
                        break;
                    case 3:
                        strTitle = "   N-1需转移的负荷 ";
                        break;
                    case 4:
                        strTitle = " 联络线路可转带负荷   ";
                        break;
                    case 5:
                        strTitle = "  主变能转带负荷  ";
                        break;
                    case 6:
                        strTitle = "  是否通过校验  ";
                        break;
                    case 7:
                        strTitle = "  损失负荷  ";
                        break;

                    default:
                        break;
                }
                PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
                PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);
            }

            NextRowMerge = 1;
            NextColMerge = 1;

            IntRow = 6;
            IntCol = 0;
            //PF.SetWholeRowHeight(obj, obj.Rows.Count, obj.Columns.Count);//行高
            WriteData(FB, obj, IntRow);
        }
Пример #12
0
        //////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// 填写表头
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="Title"></param>
        public void SetSheet_6Title(Itop.Client.Base.FormBase FB, FarPoint.Win.Spread.SheetView obj, string Title)
        {
            int IntColCount = 14;
            int IntRowCount = 6 + 2 + 3;//标题占3行,分区类型占2行
            string title = null;

            obj.SheetName = Title;
            obj.Columns.Count = IntColCount;
            obj.Rows.Count = IntRowCount;
            IntCol = obj.Columns.Count;

            PF.Sheet_GridandCenter(obj);//画边线,居中
            m_PF.LockSheets(obj);

            string strTitle = "";
            IntRow = 3;
            strTitle = Title;
            PF.CreateSheetView(obj, IntRow, IntCol, 0, 0, Title);
            PF.SetSheetViewColumnsWidth(obj, 0, Title);
            IntCol = 1;

            strTitle = "单位:公里 万千伏安 台";
            obj.AddSpanCell(IntRow, 0, 1, obj.Columns.Count);
            obj.SetValue(IntRow, 0, strTitle);
            PF.SetSheetViewColumnsWidth(obj, 0, strTitle);
            //右对齐
            obj.Rows[IntRow].HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Right;
            //列标题
            strTitle = "序号";
            PF.CreateSheetView(obj, NextRowMerge += 1, NextColMerge, IntRow += 1, IntCol -= 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            for (int i = 0; i < (IntColCount - 1); ++i)
            {
                switch (i)
                {
                    case 0:
                        strTitle = " 变电站   ";
                        break;
                    case 1:
                        strTitle = " 线路名称   ";
                        break;
                    case 2:
                        strTitle = "  出口导线型号  ";
                        break;
                    case 3:
                        strTitle = "   架空线长度 ";
                        break;
                    case 4:
                        strTitle = " 电缆线长度   ";
                        break;
                    case 5:
                        strTitle = " 线路总长度   ";
                        break;
                    case 6:
                        strTitle = "  主干线路长度  ";
                        break;
                    case 11:
                        strTitle = "  配变台数  ";
                        break;
                    case 12:
                        strTitle = " 配变容量  ";
                        break;
                    default:
                        break;
                }
                if(i==7)
                {
                    strTitle = "  公变  ";
                    PF.CreateSheetView(obj, 1, 2, IntRow, IntCol += 1, strTitle);
                    PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);
                    PF.CreateSheetView(obj, 1, 1, IntRow + 1, IntCol , "台数");
                }
                else if(i==8)
                {
                    PF.CreateSheetView(obj, 1, 1, IntRow + 1, IntCol += 1, "容量");
                }
                else if(i==9)
                {
                    strTitle = "  专变  ";
                    PF.CreateSheetView(obj, 1, 2, IntRow, IntCol += 1, strTitle);
                    PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);
                    PF.CreateSheetView(obj, 1, 1, IntRow + 1, IntCol, "台数");
                }
                else if(i==10)
                {
                    PF.CreateSheetView(obj, 1, 1, IntRow + 1, IntCol += 1, "容量");
                }
                else
                {
                    PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
                    PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);
                }
            }

            NextRowMerge = 1;
            NextColMerge = 1;

            IntRow = 5;
            IntCol = 0;
            //PF.SetWholeRowHeight(obj, obj.Rows.Count, obj.Columns.Count);//行高
        }
Пример #13
0
        /// <summary>
        /// 重绘
        /// </summary>
        /// <param name="FB"></param>
        /// <param name="obj"></param>
        /// <param name="strEndYear"></param>
        private void ReDraw(Itop.Client.Base.FormBase FB, FarPoint.Win.Spread.SheetView obj, string strEndYear)
        {
            int IntColCount = 14;
            int ColCount = 0;
            for(int i=0;i<BDZList.Count;++i)
            {
                ColCount += LineList[i].Count;
            }
            int IntRowCount = ColCount+1 + 2 + 3;//标题占3行,分区类型占2行

            obj.RowCount = 0;
            obj.ColumnCount = 0;
            obj.Columns.Count = IntColCount;
            obj.Rows.Count = IntRowCount;
            IntCol = obj.Columns.Count;

            PF.Sheet_GridandCenter(obj);//画边线,居中
            m_PF.LockSheets(obj);

            string strTitle = "附表6 截至" + strEndYear + "年底铜陵县10kV线路基本情况";
            obj.SheetName = strTitle;
            IntRow = 3;
            PF.CreateSheetView(obj, IntRow, IntCol, 0, 0, strTitle);
            PF.SetSheetViewColumnsWidth(obj, 0, strTitle);
            IntCol = 1;

            strTitle = "单位:公里 万千伏安 台";
            obj.AddSpanCell(IntRow, 0, 1, obj.Columns.Count);
            obj.SetValue(IntRow, 0, strTitle);
            PF.SetSheetViewColumnsWidth(obj, 0, strTitle);
            //右对齐
            obj.Rows[IntRow].HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Right;
            //列标题
            strTitle = "序号";
            PF.CreateSheetView(obj, NextRowMerge += 1, NextColMerge, IntRow += 1, IntCol -= 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            for (int i = 0; i < (IntColCount - 1); ++i)
            {
                switch (i)
                {
                    case 0:
                        strTitle = " 变电站   ";
                        break;
                    case 1:
                        strTitle = " 线路名称   ";
                        break;
                    case 2:
                        strTitle = "  出口导线型号  ";
                        break;
                    case 3:
                        strTitle = "   架空线长度 ";
                        break;
                    case 4:
                        strTitle = " 电缆线长度   ";
                        break;
                    case 5:
                        strTitle = " 线路总长度   ";
                        break;
                    case 6:
                        strTitle = "  主干线路长度  ";
                        break;
                    case 11:
                        strTitle = "  配变台数  ";
                        break;
                    case 12:
                        strTitle = " 配变容量  ";
                        break;
                    default:
                        break;
                }
                if (i == 7)
                {
                    strTitle = "  公变  ";
                    PF.CreateSheetView(obj, 1, 2, IntRow, IntCol += 1, strTitle);
                    PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);
                    PF.CreateSheetView(obj, 1, 1, IntRow + 1, IntCol, "台数");
                }
                else if (i == 8)
                {
                    PF.CreateSheetView(obj, 1, 1, IntRow + 1, IntCol += 1, "容量");
                }
                else if (i == 9)
                {
                    strTitle = "  专变  ";
                    PF.CreateSheetView(obj, 1, 2, IntRow, IntCol += 1, strTitle);
                    PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);
                    PF.CreateSheetView(obj, 1, 1, IntRow + 1, IntCol, "台数");
                }
                else if (i == 10)
                {
                    PF.CreateSheetView(obj, 1, 1, IntRow + 1, IntCol += 1, "容量");
                }
                else
                {
                    PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
                    PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);
                }
            }

            NextRowMerge = 1;
            NextColMerge = 1;

            IntRow = 6;
            IntCol = 0;

            WriteData(FB,obj,IntRow);
        }
Пример #14
0
 /// <summary>
 /// ���ñ���������� SheetName���ϲ���һ�мӱ���
 /// </summary>
 /// <param name="obj_sheet"></param>
 /// <param name="rowcount">����</param>
 /// <param name="colcount">����</param>
 /// <param name="title">������</param>
 /// <param name="sheetname">������ǩ��</param>
 public void Sheet_RowCol_Title_Name(FarPoint.Win.Spread.SheetView obj_sheet, int rowcount, int colcount, string title, string sheetname)
 {
     obj_sheet.RowCount = rowcount;
     obj_sheet.ColumnCount = colcount;
     obj_sheet.SheetName = sheetname;
     obj_sheet.AddSpanCell(0, 0, 1, colcount);
     obj_sheet.SetValue(0, 0, title);
     obj_sheet.Rows[0].Height = 35;
 }
Пример #15
0
 /// <summary>
 /// ������������������еĶ�̬��ѹ�б���
 /// </summary>
 /// <param name="obj_sheet"></param>
 /// <param name="SxXjName">��Ͻ�ؼ����Ƽ�����б�</param>
 /// <param name="startrow">��̬�б�����ʼ�к�</param>
 /// <param name="obj_DY_List">��̬��ѹ�б�</param>
 public void Sheet_AddItem_ZBonlyDY(FarPoint.Win.Spread.SheetView obj_sheet, List<string[]> SxXjName, int startrow, IList<double> obj_DY_List)
 {
     //����������
     int dylength = obj_DY_List.Count;
     if (obj_DY_List.Count > 0)
     {
         for (int i = 0; i < SxXjName.Count; i++)
         {
             for (int j = 0; j < obj_DY_List.Count; j++)
             {
                 obj_sheet.SetValue(startrow + i * dylength + j, 2, obj_DY_List[j].ToString());
             }
             obj_sheet.AddSpanCell(startrow + i * dylength, 0, dylength, 1);
             obj_sheet.SetValue(startrow + i * dylength, 0, SxXjName[i][0].ToString());
             obj_sheet.AddSpanCell(startrow + i * dylength, 1, dylength, 1);
             obj_sheet.SetValue(startrow + i * dylength, 1, SxXjName[i][1].ToString());
         }
     }
 }
Пример #16
0
        /// <summary>
        /// 重绘
        /// </summary>
        /// <param name="FB"></param>
        /// <param name="obj"></param>
        /// <param name="strEndYear"></param>
        private void ReDraw(Itop.Client.Base.FormBase FB, FarPoint.Win.Spread.SheetView obj, string strEndYear)
        {
            obj.RowCount = 0;
            obj.ColumnCount = 0;
            int IntColCount = 11;
            int RowCount = 0;
            if(list != null)
            {
                RowCount = list.Count;
            }
            int IntRowCount = RowCount + 1 + 2 + 3;//标题占3行,分区类型占2行
            string title = null;

            obj.Columns.Count = IntColCount;
            obj.Rows.Count = IntRowCount;
            IntCol = obj.Columns.Count;

            PF.Sheet_GridandCenter(obj);//画边线,居中
            m_PF.LockSheets(obj);

            string strTitle = "附表9 截至"+strEndYear+"年底铜陵县中压配电线路运行情况";
            IntRow = 3;
            obj.SheetName = strTitle;
            PF.CreateSheetView(obj, IntRow, IntCol, 0, 0, strTitle);
            PF.SetSheetViewColumnsWidth(obj, 0, strTitle);
            IntCol = 1;

            strTitle = "单位:千伏 安培 万千瓦 万千伏安 %";
            obj.AddSpanCell(IntRow, 0, 1, obj.Columns.Count);
            obj.SetValue(IntRow, 0, strTitle);
            PF.SetSheetViewColumnsWidth(obj, 0, strTitle);
            //右对齐
            obj.Rows[IntRow].HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Right;
            //列标题
            strTitle = "序号";
            PF.CreateSheetView(obj, NextRowMerge += 1, NextColMerge, IntRow += 1, IntCol -= 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            for (int i = 0; i < (IntColCount - 1); ++i)
            {
                switch (i)
                {
                    case 0:
                        strTitle = " 变电站   ";
                        break;
                    case 1:
                        strTitle = " 线路名称   ";
                        break;
                    case 2:
                        strTitle = "  电压等级  ";
                        break;
                    case 3:
                        strTitle = "   出口导线型号 ";
                        break;
                    case 4:
                        strTitle = " 线路类型   ";
                        break;
                    case 5:
                        strTitle = " 最大允许电流   ";
                        break;
                    case 6:
                        strTitle = "  线路最大负荷  ";
                        break;
                    case 7:
                        strTitle = "  线路负载率  ";
                        break;
                    case 8:
                        strTitle = "  该线路所带配变总容量  ";
                        break;
                    case 9:
                        strTitle = "  配变综合负载率  ";
                        break;

                    default:
                        break;
                }

                PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
                PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);
            }

            NextRowMerge = 1;
            NextColMerge = 1;

            IntRow = 6;
            IntCol = 0;
            WriteData(FB, obj, strEndYear, IntRow);
        }
Пример #17
0
        //////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// 填写表头
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="Title"></param>
        public void SetSheet_9Title(Itop.Client.Base.FormBase FB, FarPoint.Win.Spread.SheetView obj, string Title)
        {
            int IntColCount = 11;
            int IntRowCount = 6 + 2 + 3;//标题占3行,分区类型占2行
            string title = null;

            obj.SheetName = Title;
            obj.Columns.Count = IntColCount;
            obj.Rows.Count = IntRowCount;
            IntCol = obj.Columns.Count;

            PF.Sheet_GridandCenter(obj);//画边线,居中
            m_PF.LockSheets(obj);

            string strTitle = "";
            IntRow = 3;
            strTitle = Title;
            PF.CreateSheetView(obj, IntRow, IntCol, 0, 0, Title);
            PF.SetSheetViewColumnsWidth(obj, 0, Title);
            IntCol = 1;

            strTitle = "单位:千伏 安培 万千瓦 万千伏安 %";
            obj.AddSpanCell(IntRow, 0, 1, obj.Columns.Count);
            obj.SetValue(IntRow, 0, strTitle);
            PF.SetSheetViewColumnsWidth(obj, 0, strTitle);
            //右对齐
            obj.Rows[IntRow].HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Right;
            //列标题
            strTitle = "序号";
            PF.CreateSheetView(obj, NextRowMerge += 1, NextColMerge, IntRow += 1, IntCol -= 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            for (int i = 0; i < (IntColCount - 1); ++i)
            {
                switch (i)
                {
                    case 0:
                        strTitle = " 变电站   ";
                        break;
                    case 1:
                        strTitle = " 线路名称   ";
                        break;
                    case 2:
                        strTitle = "  电压等级  ";
                        break;
                    case 3:
                        strTitle = "   出口导线型号 ";
                        break;
                    case 4:
                        strTitle = " 线路类型   ";
                        break;
                    case 5:
                        strTitle = " 最大允许电流   ";
                        break;
                    case 6:
                        strTitle = "  线路最大负荷  ";
                        break;
                    case 7:
                        strTitle = "  线路负载率  ";
                        break;
                    case 8:
                        strTitle = "  该线路所带配变总容量  ";
                        break;
                    case 9:
                        strTitle = "  配变综合负载率  ";
                        break;

                    default:
                        break;
                }

                PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
                PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);
            }

            NextRowMerge = 1;
            NextColMerge = 1;

            IntRow = 5;
            IntCol = 0;
            //PF.SetWholeRowHeight(obj, obj.Rows.Count, obj.Columns.Count);//行高
        }
Пример #18
0
        //////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// 填写表头
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="Title"></param>
        public void SetSheet_23Title(Itop.Client.Base.FormBase FB, FarPoint.Win.Spread.SheetView obj, string Title)
        {
            int Temp = 0;
            int IntColCount = 12;
            ReturnBDZ(FB);
            int IntRowCount = ReturnRow(BDZList)+1 + 2 + 3;//标题占3行,分区类型占2行

            int BringIntoPproductionTime = 6;//投产时间的列数

            string title = null;

            obj.SheetName = Title;
            obj.Columns.Count = IntColCount;
            obj.Rows.Count = IntRowCount;
            IntCol = obj.Columns.Count;

            PF.Sheet_GridandCenter(obj);//画边线,居中
            m_PF.LockSheets(obj);

            string strTitle = "";
            IntRow = 3;
            strTitle = Title;
            PF.CreateSheetView(obj, IntRow, IntCol, 0, 0, Title);
            PF.SetSheetViewColumnsWidth(obj, 0, Title);
            IntCol = 1;

            strTitle = "  单位:万千瓦 万千伏安";
            obj.AddSpanCell(IntRow, 0, 1, obj.Columns.Count);
            obj.SetValue(IntRow, 0, strTitle);
            PF.SetSheetViewColumnsWidth(obj, 0, strTitle);
            //右对齐

            obj.Rows[IntRow].HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Right;
            //列标题

            IntRow = 4;
            strTitle = "变电站名称";
            PF.CreateSheetView(obj, NextRowMerge+=1, NextColMerge, IntRow, IntCol-=1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            strTitle = "主变容量";
            PF.CreateSheetView(obj, NextRowMerge , NextColMerge, IntRow, IntCol += 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            strTitle = "10kV线路所带负荷";
            PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            strTitle = "需转供负荷";
            PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            strTitle = "联络的变电站";
            PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            strTitle = "联络线路条数";
            PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            strTitle = "联络线路能转带的负荷";
            PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            strTitle = "联络变电站能转带的负荷";
            PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            strTitle = "通过联络可转带的负荷";
            PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            strTitle = "通过主变能转带负荷";
            PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            strTitle = "需通过10kV网络转带负荷";
            PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            strTitle = "是否通过";
            PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            NextRowMerge = 1;
            NextColMerge = 1;

            IntRow = 6;
            IntCol = 0;
            //PF.SetWholeRowHeight(obj, obj.Rows.Count, obj.Columns.Count);//行高
            //SetLeftTitle();
            WriteData(FB, obj, IntRow);
        }
Пример #19
0
        public void Build_Sheet(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            //���9 ��11 ��
            rowcount = 9;
            colcount = 11;
            //�������һ�еı���
            title = TC.GetTableTitle(this.GetType().Name);
            //����������
            //int[] TableYearsAry = TC.GetTableYears(this.GetType().Name);
            //��������
            sheetname = title;
            //�趨����������ֵ������ͱ���
            TC.Sheet_RowCol_Title_Name(obj_sheet, rowcount, colcount, title, sheetname);
            //�趨����ģʽ���Ա�д��ʽʹ��
            TC.Sheet_Referen_R1C1(obj_sheet);
            //�趨����п��
            obj_sheet.Columns[0].Width = 60;
            obj_sheet.Columns[1].Width = 100;
            obj_sheet.Columns[2].Width = 60;
            obj_sheet.Columns[3].Width = 60;
            obj_sheet.Columns[4].Width = 60;
            obj_sheet.Columns[5].Width = 60;
            obj_sheet.Columns[6].Width = 60;
            obj_sheet.Columns[7].Width = 60;
            obj_sheet.Columns[8].Width = 60;
            obj_sheet.Columns[9].Width = 60;
            obj_sheet.Columns[10].Width = 60;
            //�趨����и߶�
            obj_sheet.Rows[0].Height = 20;
            obj_sheet.Rows[1].Height = 20;
            obj_sheet.Rows[2].Height = 20;
            //���������

            //2�������
            obj_sheet.AddSpanCell(1, 0, 2, 1);
            obj_sheet.SetValue(1, 0, "����");
            obj_sheet.SetValue(1, 1, "װ���������");
            obj_sheet.AddSpanCell(1, 2, 2, 1);
            obj_sheet.SetValue(1, 2, "<2");
            obj_sheet.AddSpanCell(1, 3, 2, 1);
            obj_sheet.SetValue(1, 3, "2~4");
            obj_sheet.AddSpanCell(1, 4, 2, 1);
            obj_sheet.SetValue(1, 4, "4~6");
            obj_sheet.AddSpanCell(1, 5, 2, 1);
            obj_sheet.SetValue(1, 5, "6~8");
            obj_sheet.AddSpanCell(1, 6, 2, 1);
            obj_sheet.SetValue(1, 6, "8~10");
            obj_sheet.AddSpanCell(1, 7, 2, 1);
            obj_sheet.SetValue(1, 7, "10~12");
            obj_sheet.AddSpanCell(1, 8, 2, 1);
            obj_sheet.SetValue(1, 8, "12~15");
            obj_sheet.AddSpanCell(1, 9, 2, 1);
            obj_sheet.SetValue(1, 9, ">15");
            obj_sheet.AddSpanCell(1, 10, 2, 1);
            obj_sheet.SetValue(1, 10, "�ϼ�");

            //3�������
            obj_sheet.SetValue(2, 1, "����ǧ������");
            //���������
            //�������
            Sheet_AddData(obj_sheet);

            //�趨�����
            TC.Sheet_GridandCenter(obj_sheet);

            //�������
            TC.Sheet_Locked(obj_sheet);
        }
Пример #20
0
        private void Sheet_AddItem(FarPoint.Win.Spread.SheetView obj_sheet,Hashtable area_key_id, IList<double> obj_DY_List, IList<string> SXareaid_List, IList<string> XJareaid_List)
        {
            //写标题行内容
            //2行标题内容
            obj_sheet.AddSpanCell(1, 0, 2, 1);
            obj_sheet.SetValue(1, 0, "分区类型");
            obj_sheet.AddSpanCell(1, 1, 2, 1);
            obj_sheet.SetValue(1, 1, "分区名称");
            obj_sheet.AddSpanCell(1, 2, 1, 2);
            obj_sheet.SetValue(1, 2, "配变低压侧补偿");
            obj_sheet.AddSpanCell(1, 4, 1, 2);
            obj_sheet.SetValue(1, 4, "中压线路补偿");
            obj_sheet.AddSpanCell(1, 6, 2, 1);
            obj_sheet.SetValue(1, 6, "无功补偿总容量(Mvar)");

            //3行标题内容
            obj_sheet.SetValue(2, 2, "配变总台数(台)");
            obj_sheet.SetValue(2, 3, "无功补偿容量(Mvar)");
            obj_sheet.SetValue(2, 4, "线路条数(条)");
            obj_sheet.SetValue(2, 5, "无功补偿容量(Mvar)");
            //写标题列内容
            int startrow = 3;
               for (int i = 0; i < (2 + SXareaid_List.Count + XJareaid_List.Count); i++)
                {
                    string areaname = "";
                    if (i == 0 || i == (SXareaid_List.Count + 1))
                    {
                        areaname = "合计";
                    }
                    else
                    {
                        if (i < SXareaid_List.Count + 1)
                        {
                            if (area_key_id[SXareaid_List[i - 1].ToString()] != null)
                            {
                                areaname = area_key_id[SXareaid_List[i - 1].ToString()].ToString();
                            }
                            else
                            {
                                areaname = "";
                            }

                        }
                        else
                        {
                            if (area_key_id[XJareaid_List[i - SXareaid_List.Count - 2].ToString()] != null)
                            {
                                areaname = area_key_id[XJareaid_List[i - SXareaid_List.Count - 2].ToString()].ToString();
                            }
                            else
                            {
                                areaname = "";
                            }
                        }
                    }
                    obj_sheet.SetValue(startrow + i , 1, areaname);

                }
                //写第一列数据
                obj_sheet.AddSpanCell(startrow, 0, (SXareaid_List.Count + 1) , 1);
                obj_sheet.SetValue(startrow, 0, "市辖供电区");
                obj_sheet.AddSpanCell(startrow + (SXareaid_List.Count + 1) , 0, (XJareaid_List.Count + 1) , 1);
                obj_sheet.SetValue(startrow + (SXareaid_List.Count + 1) , 0, "县级供电区");
        }
Пример #21
0
        //////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// 填写表头
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="Title"></param>
        public void SetSheet_2Title(Itop.Client.Base.FormBase FB, FarPoint.Win.Spread.SheetView obj, string Title)
        {
            SelectDQ(FB);
            int IntColCount = 2;
            int IntRowCount =1+ AreaList.Count + 1 + 2 + 3;//标题占3行,分区类型占2行,1是其它用
            string title = null;

            obj.SheetName = Title;
            obj.Columns.Count = IntColCount;
            obj.Rows.Count = IntRowCount;
            IntCol = obj.Columns.Count;

            PF.Sheet_GridandCenter(obj);//画边线,居中
            m_PF.LockSheets(obj);

            string strTitle = "";
            IntRow = 3;
            strTitle = Title;
            PF.CreateSheetView(obj, IntRow, IntCol, 0, 0, Title);
            PF.SetSheetViewColumnsWidth(obj, 0, Title);
            IntCol = 1;

            strTitle = "单位:万人、平方公里";
            obj.AddSpanCell(IntRow, 0, 1, obj.Columns.Count);
            obj.SetValue(IntRow, 0, strTitle);
            //右对齐
            obj.Rows[IntRow].HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Right;

            strTitle = " 镇/片区";
            PF.CreateSheetView(obj, NextRowMerge += 1, NextColMerge, IntRow += 1, IntCol -= 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            strTitle = "面积";
            PF.CreateSheetView(obj, NextRowMerge , NextColMerge, IntRow , IntCol += 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, "60");
            for (int i = 0; i < AreaList.Count+1; ++i)
            {
                if(i!=AreaList.Count)
                {
                    PF.CreateSheetView(obj, 1, NextColMerge, (IntRow + i + 2), 0, AreaList[i].ToString());
                    PF.SetSheetViewColumnsWidth(obj, IntCol, AreaList[i].ToString());
                }
                else
                {
                    PF.CreateSheetView(obj, 1, NextColMerge, (IntRow + i + 2), 0, "合计");
                }
            }

            NextRowMerge = 1;
            NextColMerge = 1;

            IntRow = 5;
            IntCol = 0;
            //PF.SetWholeRowHeight(obj, obj.Rows.Count, obj.Columns.Count);//行高
        }
Пример #22
0
        private void Sheet_AddItem(FarPoint.Win.Spread.SheetView obj_sheet, List<string[]> SxXjName, IList<double> obj_DY_List)
        {
            //写标题行内容

            //2行标题内容
            obj_sheet.AddSpanCell(1, 0, 2, 1);
            obj_sheet.SetValue(1, 0, "编号");
            obj_sheet.AddSpanCell(1, 1, 2, 1);
            obj_sheet.SetValue(1, 1, "类型");
            obj_sheet.AddSpanCell(1, 2, 2, 1);
            obj_sheet.SetValue(1, 2, "电压等级(kV)");
            obj_sheet.AddSpanCell(1, 3, 2, 1);
            obj_sheet.SetValue(1, 3, "年限");
            obj_sheet.AddSpanCell(1, 4, 1, 2);
            obj_sheet.SetValue(1, 4, "架空");
            obj_sheet.AddSpanCell(1, 6, 1, 2);
            obj_sheet.SetValue(1, 6, "电缆");

            //3行标题内容
            obj_sheet.SetValue(2, 4, "长度(km)");
            obj_sheet.SetValue(2, 5, "比例(%)");
            obj_sheet.SetValue(2, 6, "长度(km)");
            obj_sheet.SetValue(2, 7, "比例(%)");
            //写标题列内容
            int startrow = 3;
            int dylength = obj_DY_List.Count;
            int length = 5;
            if (obj_DY_List.Count > 0)
            {
                for (int i = 0; i < SxXjName.Count; i++)
                {
                    for (int j = 0; j < obj_DY_List.Count; j++)
                    {

                        int row = startrow + i * dylength * length + j * length;
                        obj_sheet.SetValue(row, 3, "0-5年");
                        obj_sheet.SetValue(row + 1, 3, "6-10年");
                        obj_sheet.SetValue(row + 2, 3, "11-15年");
                        obj_sheet.SetValue(row + 3, 3, "16-20年");
                        obj_sheet.SetValue(row + 4, 3, "20年以上");
                        obj_sheet.AddSpanCell(startrow + i * dylength * length + j * length, 2, length, 1);
                        obj_sheet.SetValue(startrow + i * dylength * length + j * length, 2, obj_DY_List[j].ToString());
                    }
                    obj_sheet.AddSpanCell(startrow + i * dylength * length, 0, dylength * length, 1);
                    obj_sheet.SetValue(startrow + i * dylength * length, 0, SxXjName[i][0].ToString());
                    obj_sheet.AddSpanCell(startrow + i * dylength * length, 1, dylength * length, 1);
                    obj_sheet.SetValue(startrow + i * dylength * length, 1, SxXjName[i][1].ToString());
                }
            }
        }
Пример #23
0
        /// <summary>
        /// 写入列标题
        /// </summary>
        /// <param name="FB"></param>
        /// <param name="obj"></param>
        /// <param name="BeginYear"></param>
        /// <param name="EndYear"></param>
        public void SetColumnsTitle(Itop.Client.Base.FormBase FB, FarPoint.Win.Spread.SheetView obj, int BeginYear, int EndYear)
        {
            int intTemp = BeginYear;
            const int coltemp = 2;//写入列的起始点
            Redraw(FB,obj, BeginYear, EndYear);
            for (int i = BeginYear; i <= (EndYear + list.Count); ++i)
            {
                obj.AddSpanCell(4, (i - BeginYear + coltemp), 2, 1);
                //if(i!=EndYear+list.Count)//和下面eles对应
                //{
                obj.SetValue(4, (i - BeginYear + coltemp), intTemp);
                if (i == 2006)
                {
                    obj.SetValue(4, (i - BeginYear + coltemp), "“十五”年均增速");
                    intTemp--;
                }
                if (i == (2011 + 1))//中间空一行所以加一
                {
                    obj.SetValue(4, (i - BeginYear + coltemp), "“十一五”年均增速");
                    intTemp--;
                }
                if (i == (2016 + 2))
                {
                    obj.SetValue(4, (i - BeginYear + coltemp), "“十二五”年均增速");
                    intTemp--;
                }
                if (i == (2021 + 3))
                {
                    obj.SetValue(4, (i - BeginYear + coltemp), "“十三五”年均增速");
                    intTemp--;
                }
                //}
                //else//这是预计的列现在先不用
                //{
                //    if (i != 2006 && i != (2011 + 1) && i != (2016 + 2) && i != (2021 + 3))
                //    {
                //        obj.SetValue(4, (i - BeginYear + 1), intTemp + "预计");
                //    }
                //    else
                //    {
                //        if (i == 2006)
                //        {
                //            obj.SetValue(4, (i - BeginYear + 1), "“十五”年均增速");
                //            intTemp--;
                //        }
                //        if (i == (2011 + 1))//中间空一行所以加一
                //        {
                //            obj.SetValue(4, (i - BeginYear + 1), "“十一五”年均增速");
                //            intTemp--;
                //        }
                //        if (i == (2016 + 2))
                //        {
                //            obj.SetValue(4, (i - BeginYear + 1), "“十二五”年均增速");
                //            intTemp--;
                //        }
                //        if (i == (2021 + 3))
                //        {
                //            obj.SetValue(4, (i - BeginYear + 1), "“十三五”年均增速");
                //            intTemp--;
                //        }
                //    }

                //}
                intTemp++;
            }
            list.Clear();
            WriteData(FB, obj, BeginYear.ToString());
        }
Пример #24
0
 private void AddItems(FarPoint.Win.Spread.SheetView obj_sheet,string Area, int rowstart)
 {
     obj_sheet.AddSpanCell(rowstart, 0, 9, 1);
     obj_sheet.SetValue(rowstart, 0, Area);
     obj_sheet.SetValue(rowstart++, 1, "����������ֵ����Ԫ��");
     obj_sheet.SetValue(rowstart++, 1, "��һ��ҵ");
     obj_sheet.SetValue(rowstart++, 1, "�ڶ���ҵ");
     obj_sheet.SetValue(rowstart++, 1, "������ҵ");
     obj_sheet.SetValue(rowstart++, 1, "�˿ڣ����ˣ�");
     obj_sheet.SetValue(rowstart++, 1, "�˾�GDP����Ԫ��");
     obj_sheet.SetValue(rowstart++, 1, "���������ƽ��ǧ�ף�");
     obj_sheet.SetValue(rowstart++, 1, "�����������ƽ��ǧ�ף�");
     obj_sheet.SetValue(rowstart++, 1, "�����ʣ�%��");
 }
Пример #25
0
        //////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// 填写表头
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="Title"></param>
        public void SetSheet_25Title(Itop.Client.Base.FormBase FB, FarPoint.Win.Spread.SheetView obj, string Title)
        {
            int Temp = 0;
            int IntColCount = 6;
            SelectData(FB);
            int IntRowCount = HList.Count+Llist.Count+1 + 2 + 3;//标题占3行,分区类型占2行

            int BringIntoPproductionTime = 6;//投产时间的列数

            string title = null;

            obj.SheetName = Title;
            obj.Columns.Count = IntColCount;
            obj.Rows.Count = IntRowCount;
            IntCol = obj.Columns.Count;

            PF.Sheet_GridandCenter(obj);//画边线,居中
            m_PF.LockSheets(obj);

            string strTitle = "";
            IntRow = 3;
            strTitle = Title;
            PF.CreateSheetView(obj, IntRow, IntCol, 0, 0, Title);
            PF.SetSheetViewColumnsWidth(obj, 0, Title);
            IntCol = 1;

            strTitle = "  单位:亿元";
            obj.AddSpanCell(IntRow, 0, 1, obj.Columns.Count);
            obj.SetValue(IntRow, 0, strTitle);
            PF.SetSheetViewColumnsWidth(obj, 0, strTitle);
            //右对齐

            obj.Rows[IntRow].HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Right;
            //列标题

            IntRow = 4;
            strTitle = "序     号";
            PF.CreateSheetView(obj, NextRowMerge += 1, NextColMerge, IntRow, IntCol -= 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            strTitle = "项     目";
            PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            strTitle = "项目性质";
            PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            strTitle = "建设年限";
            PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            strTitle = "建设内容";
            PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            strTitle = "资     金";
            PF.CreateSheetView(obj, NextRowMerge, NextColMerge, IntRow, IntCol += 1, strTitle);
            PF.SetSheetViewColumnsWidth(obj, IntCol, strTitle);

            NextRowMerge = 1;
            NextColMerge = 1;

            IntRow = 6;
            IntCol = 0;
            //PF.SetWholeRowHeight(obj, obj.Rows.Count, obj.Columns.Count);//行高
            //SetLeftTitle();
            WriteData(obj,IntRow);
        }
Пример #26
0
        private void Sheet_AddItem(FarPoint.Win.Spread.SheetView obj_sheet,Hashtable area_key_id, IList<double> obj_DY_List, IList<string> SXareaid_List, IList<string> XJareaid_List)
        {
            //写标题行内容
            //2行标题内容
            obj_sheet.AddSpanCell(1, 0, 2, 1);
            obj_sheet.SetValue(1, 0, "分区类型");
            obj_sheet.AddSpanCell(1, 1, 2, 1);
            obj_sheet.SetValue(1, 1, "分区名称");
            obj_sheet.AddSpanCell(1, 2, 2, 1);
            obj_sheet.SetValue(1, 2, "电压等级");
            obj_sheet.AddSpanCell(1, 3, 1, 2);
            obj_sheet.SetValue(1, 3, "线路条数(条)");
            obj_sheet.AddSpanCell(1, 5, 1, 2);
            obj_sheet.SetValue(1, 5, "线路总长度(km)");
            obj_sheet.AddSpanCell(1, 7, 1, 2);
            obj_sheet.SetValue(1, 7, "其中:电缆长度(km)");
            obj_sheet.SetValue(1, 9, "平均线路长度(km)");
            obj_sheet.SetValue(1, 10, "主干线长度(km)");
            obj_sheet.SetValue(1, 11, "主干平均长度(km)");
            obj_sheet.SetValue(1, 12, "主干长度>4km条数(条)");
            obj_sheet.SetValue(1, 13, "主干长度>10km条数(条)");
            obj_sheet.AddSpanCell(1, 14, 1, 2);
            obj_sheet.SetValue(1, 14, "平均单条线路配变装接容量(MVA/条)");
            obj_sheet.AddSpanCell(1, 16, 1, 2);
            obj_sheet.SetValue(1, 16, "线路配变装接容量>12MVA线路条数(条)");
            obj_sheet.SetValue(1, 18, "架空线绝缘导线长度(km)");
            obj_sheet.SetValue(1, 19, "架空线路绝缘化率(%)");
            obj_sheet.SetValue(1, 20, "电缆化率(%)");

            //3行标题内容
            obj_sheet.SetValue(2, 3, "公用");
            obj_sheet.SetValue(2, 4, "专用");
            obj_sheet.SetValue(2, 5, "公用");
            obj_sheet.SetValue(2, 6, "专用");
            obj_sheet.SetValue(2, 7, "公用");
            obj_sheet.SetValue(2, 8, "专用");
            obj_sheet.SetValue(2, 9, "公用");
            obj_sheet.SetValue(2, 10, "公用");
            obj_sheet.SetValue(2, 11, "公用");
            obj_sheet.SetValue(2, 12, "公用");
            obj_sheet.SetValue(2, 13, "公用");
            obj_sheet.SetValue(2, 14, "公用线路");
            obj_sheet.SetValue(2, 15, "专用线路");
            obj_sheet.SetValue(2, 16, "公用线路");
            obj_sheet.SetValue(2, 17, "专用线路");
            obj_sheet.SetValue(2, 18, "公用");
            obj_sheet.SetValue(2, 19, "公用");
            obj_sheet.SetValue(2, 20, "公用");
            //写标题列内容
            fc.Sheet_AddItem_FBonlyDY(obj_sheet, area_key_id, 3, obj_DY_List, SXareaid_List, XJareaid_List);
        }
Пример #27
0
        public void Build_Sheet(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            //���27 ��13 ��
            rowcount = 27;
            colcount = 13;
            //�������һ�еı���
            title = TC.GetTableTitle(this.GetType().Name);
            //����������
            //int[] TableYearsAry = TC.GetTableYears(this.GetType().Name);
            //��������
            sheetname = title;
            //�趨����������ֵ������ͱ���
            TC.Sheet_RowCol_Title_Name(obj_sheet, rowcount, colcount, title, sheetname);
            //�趨����ģʽ���Ա�д��ʽʹ��
            TC.Sheet_Referen_R1C1(obj_sheet);
            //�趨����п��
            obj_sheet.Columns[0].Width = 60;
            obj_sheet.Columns[1].Width = 60;
            obj_sheet.Columns[2].Width = 100;
            obj_sheet.Columns[3].Width = 60;
            obj_sheet.Columns[4].Width = 60;
            obj_sheet.Columns[5].Width = 60;
            obj_sheet.Columns[6].Width = 60;
            obj_sheet.Columns[7].Width = 60;
            obj_sheet.Columns[8].Width = 60;
            obj_sheet.Columns[9].Width = 60;
            obj_sheet.Columns[10].Width = 60;
            obj_sheet.Columns[11].Width = 100;
            obj_sheet.Columns[12].Width = 100;
            //�趨����и߶�
            obj_sheet.Rows[0].Height = 20;
            obj_sheet.Rows[1].Height = 20;
            //���������

            //2�������
            obj_sheet.SetValue(1, 0, "����");
            obj_sheet.SetValue(1, 1, "��Ŀ");
            obj_sheet.SetValue(1, 2, "���������䣨%��");
            obj_sheet.SetValue(1, 3, "<20");
            obj_sheet.SetValue(1, 4, "20~40");
            obj_sheet.SetValue(1, 5, "40~50");
            obj_sheet.SetValue(1, 6, "50~67");
            obj_sheet.SetValue(1, 7, "67~75");
            obj_sheet.SetValue(1, 8, "75~80");
            obj_sheet.SetValue(1, 9, "80~100");
            obj_sheet.SetValue(1, 10, ">100");
            obj_sheet.SetValue(1, 11, "������·������%��");
            obj_sheet.SetValue(1, 12, "������·������%��");
            //���������

            //1�������
            obj_sheet.AddSpanCell(2, 0, 8, 1);
            obj_sheet.SetValue(2, 0, "XX�����أ�");
            obj_sheet.AddSpanCell(10, 0, 8, 1);
            obj_sheet.SetValue(10, 0, "xx�����أ�22");
            obj_sheet.AddSpanCell(18, 0, 8, 1);
            obj_sheet.SetValue(18, 0, "ȫ�кϼ�");
            obj_sheet.AddSpanCell(26, 0, 1, 3);
            obj_sheet.SetValue(26, 0, "�ϼ�");

            //2�������
            obj_sheet.AddSpanCell(2, 1, 6, 1);
            obj_sheet.SetValue(2, 1, "���ͽ��ߣ��أ�");
            obj_sheet.AddSpanCell(8, 1, 1, 2);
            obj_sheet.SetValue(8, 1, "������");
            obj_sheet.AddSpanCell(9, 1, 1, 2);
            obj_sheet.SetValue(9, 1, "�����ǵ��ͽ��ߣ��أ�");
            obj_sheet.AddSpanCell(10, 1, 6, 1);
            obj_sheet.SetValue(10, 1, "���ͽ��ߣ��أ�");
            obj_sheet.AddSpanCell(16, 1, 1, 2);
            obj_sheet.SetValue(16, 1, "������");
            obj_sheet.AddSpanCell(17, 1, 1, 2);
            obj_sheet.SetValue(17, 1, "�����ǵ��ͽ��ߣ��أ�");
            obj_sheet.AddSpanCell(18, 1, 6, 1);
            obj_sheet.SetValue(18, 1, "���ͽ��ߣ��أ�");
            obj_sheet.AddSpanCell(24, 1, 1, 2);
            obj_sheet.SetValue(24, 1, "������");
            obj_sheet.AddSpanCell(25, 1, 1, 2);
            obj_sheet.SetValue(25, 1, "�����ǵ��ͽ��ߣ��أ�");

            //3�������
            obj_sheet.SetValue(2, 2, "����һ��");
            obj_sheet.SetValue(3, 2, "����һ��");
            obj_sheet.SetValue(4, 2, "������");
            obj_sheet.SetValue(5, 2, "˫����");
            obj_sheet.SetValue(6, 2, "��ֶ�������");
            obj_sheet.SetValue(7, 2, "��ֶ�������");
            obj_sheet.SetValue(10, 2, "����һ��");
            obj_sheet.SetValue(11, 2, "����һ��");
            obj_sheet.SetValue(12, 2, "������");
            obj_sheet.SetValue(13, 2, "˫����");
            obj_sheet.SetValue(14, 2, "��ֶ�������");
            obj_sheet.SetValue(15, 2, "��ֶ�������");
            obj_sheet.SetValue(18, 2, "����һ��");
            obj_sheet.SetValue(19, 2, "����һ��");
            obj_sheet.SetValue(20, 2, "������");
            obj_sheet.SetValue(21, 2, "˫����");
            obj_sheet.SetValue(22, 2, "��ֶ�������");
            obj_sheet.SetValue(23, 2, "��ֶ�������");
            //�������
            Sheet_AddData(obj_sheet);

            //�趨�����
            TC.Sheet_GridandCenter(obj_sheet);

            //�������
            TC.Sheet_Locked(obj_sheet);
        }
Пример #28
0
        //////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// 填写表头
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="Title"></param>
        public void SetSheet_20Title(Itop.Client.Base.FormBase FB, FarPoint.Win.Spread.SheetView obj, string Title)
        {
            SelectedPower(FB);
            int Temp = 0;
            int IntColCount = 11;
            int IntRowCount = list.Count+1 + 2 + 3;//标题占3行,分区类型占2行

            int BringIntoPproductionTime = 6;//投产时间的列数

            string title = null;

            obj.SheetName = Title;
            obj.Columns.Count = IntColCount;
            obj.Rows.Count = IntRowCount;
            IntCol = obj.Columns.Count;

            PF.Sheet_GridandCenter(obj);//画边线,居中
            m_PF.LockSheets(obj);

            string strTitle = "";
            IntRow = 3;
            strTitle = Title;
            PF.CreateSheetView(obj, IntRow, IntCol, 0, 0, Title);
            PF.SetSheetViewColumnsWidth(obj, 0, Title);
            IntCol = 1;

            strTitle = "  单位:万千瓦  千伏";
            obj.AddSpanCell(IntRow, 0, 1, obj.Columns.Count);
            obj.SetValue(IntRow, 0, strTitle);
            PF.SetSheetViewColumnsWidth(obj, 0, strTitle);
            //右对齐

            obj.Rows[IntRow].HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Right;
            //列标题

            IntRow = 4;
            for (int j = 0; j < obj.ColumnCount - BringIntoPproductionTime; ++j)
            {
                switch (j)
                {
                    case 0:
                        strTitle = "序     号";
                        break;
                    case 1:
                        strTitle = "项目名称";
                        break;
                    case 2:
                        strTitle = "类     型";
                        break;
                    case 3:
                        strTitle = "容     量";
                        break;
                    case 4:
                        strTitle = "接入电压等级";
                        break;

                }
                PF.CreateSheetView(obj, 2, 1, IntRow, j, strTitle);
                PF.SetSheetViewColumnsWidth(obj, j, strTitle);
            }
            strTitle = "投产时间";
            PF.CreateSheetView(obj, 1, BringIntoPproductionTime, IntRow, 5, strTitle);
            for (int i = 0; i < BringIntoPproductionTime;++i )
            {
                Temp = 2010 + i;
                strTitle = Temp.ToString();
                PF.CreateSheetView(obj, 1, 1, IntRow+1, 5+i, strTitle);
                PF.SetSheetViewColumnsWidth(obj, 5+i, strTitle);
            }

            NextRowMerge = 1;
            NextColMerge = 1;

            IntRow = 6;
            IntCol = 0;

            WriteData(obj, IntRow);
            //PF.SetWholeRowHeight(obj, obj.Rows.Count, obj.Columns.Count);//行高
        }
Пример #29
0
        private void Sheet_AddItem(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            //写标题行内容

            //2行标题内容
            obj_sheet.AddSpanCell(1, 0, 2, 1);
            obj_sheet.SetValue(1, 0, "编号");
            obj_sheet.AddSpanCell(1, 1, 2, 1);
            obj_sheet.SetValue(1, 1, "类型");
            obj_sheet.AddSpanCell(1, 2, 2, 1);
            obj_sheet.SetValue(1, 2, "电压等级(kV)");
            obj_sheet.AddSpanCell(1, 3, 2, 1);
            obj_sheet.SetValue(1, 3, "年限");
            obj_sheet.AddSpanCell(1, 4, 1, 2);
            obj_sheet.SetValue(1, 4, "主变台数");
            obj_sheet.AddSpanCell(1, 6, 1, 2);
            obj_sheet.SetValue(1, 6, "断路器");

            //3行标题内容
            obj_sheet.SetValue(2, 4, "数量(台)");
            obj_sheet.SetValue(2, 5, "比例(%)");
            obj_sheet.SetValue(2, 6, "数量(台)");
            obj_sheet.SetValue(2, 7, "比例(%)");
            //写标题列内容

            //1列标题内容
            obj_sheet.AddSpanCell(3, 0, 10, 1);
            obj_sheet.SetValue(3, 0, "1");
            obj_sheet.AddSpanCell(13, 0, 10, 1);
            obj_sheet.SetValue(13, 0, "2");
            obj_sheet.AddSpanCell(23, 0, 10, 1);
            obj_sheet.SetValue(23, 0, "2.1");
            obj_sheet.AddSpanCell(33, 0, 10, 1);
            obj_sheet.SetValue(33, 0, "2.2");
            obj_sheet.AddSpanCell(43, 0, 10, 1);
            obj_sheet.SetValue(43, 0, "2.3");
            obj_sheet.AddSpanCell(53, 0, 10, 1);
            obj_sheet.SetValue(53, 0, "2.4");
            obj_sheet.AddSpanCell(63, 0, 10, 1);
            obj_sheet.SetValue(63, 0, "3");

            //2列标题内容
            obj_sheet.AddSpanCell(3, 1, 10, 1);
            obj_sheet.SetValue(3, 1, "市辖供电区");
            obj_sheet.AddSpanCell(13, 1, 10, 1);
            obj_sheet.SetValue(13, 1, "县级供电区");
            obj_sheet.AddSpanCell(23, 1, 10, 1);
            obj_sheet.SetValue(23, 1, "其中:直供直管");
            obj_sheet.AddSpanCell(33, 1, 10, 1);
            obj_sheet.SetValue(33, 1, "控股");
            obj_sheet.AddSpanCell(43, 1, 10, 1);
            obj_sheet.SetValue(43, 1, "参股");
            obj_sheet.AddSpanCell(53, 1, 10, 1);
            obj_sheet.SetValue(53, 1, "代管");
            obj_sheet.AddSpanCell(63, 1, 10, 1);
            obj_sheet.SetValue(63, 1, "全地区");

            //偱环添加列标题
            for (int row = 3; row <= 72; row++)
            {
                obj_sheet.SetValue(row + 0, 3, "0-5年");
                obj_sheet.SetValue(row + 1, 3, "6-10年");
                obj_sheet.SetValue(row + 2, 3, "11-15年");
                obj_sheet.SetValue(row + 3, 3, "16-20年");
                obj_sheet.SetValue(row + 4, 3, "20年以上");
                obj_sheet.AddSpanCell(row + 0, 2, 5, 1);
                obj_sheet.SetValue(row + 0, 2, "110(66)");

                obj_sheet.SetValue(row + 5, 3, "0-5年");
                obj_sheet.SetValue(row + 6, 3, "6-10年");
                obj_sheet.SetValue(row + 7, 3, "11-15年");
                obj_sheet.SetValue(row + 8, 3, "16-20年");
                obj_sheet.SetValue(row + 9, 3, "20年以上");
                obj_sheet.AddSpanCell(row + 5, 2, 5, 1);
                obj_sheet.SetValue(row + 5, 2, "35");

                row = row + 9;
            }
        }
Пример #30
0
        private void Sheet_AddItem(FarPoint.Win.Spread.SheetView obj_sheet, Hashtable area_key_id, IList<double> obj_DY_List, IList<string> SXareaid_List, IList<string> XJareaid_List)
        {
            //2行标题内容
            obj_sheet.AddSpanCell(1, 0, 2, 1);
            obj_sheet.SetValue(1, 0, "分区类型");
            obj_sheet.AddSpanCell(1, 1, 2, 1);
            obj_sheet.SetValue(1, 1, "分区名称");
            obj_sheet.AddSpanCell(1, 2, 2, 1);
            obj_sheet.SetValue(1, 2, "电压等级(kV)");
            obj_sheet.AddSpanCell(1, 3, 2, 1);
            obj_sheet.SetValue(1, 3, "公变台数(台)");
            obj_sheet.AddSpanCell(1, 4, 2, 1);
            obj_sheet.SetValue(1, 4, "公变容量(MVA)");
            obj_sheet.AddSpanCell(1, 5, 2, 1);
            obj_sheet.SetValue(1, 5, "专变台数(台)");
            obj_sheet.AddSpanCell(1, 6, 2, 1);
            obj_sheet.SetValue(1, 6, "专变容量(MVA)");
            obj_sheet.AddSpanCell(1, 7, 2, 1);
            obj_sheet.SetValue(1, 7, "总台数(台)");
            obj_sheet.AddSpanCell(1, 8, 2, 1);
            obj_sheet.SetValue(1, 8, "总容量(MVA)");
            obj_sheet.AddSpanCell(1, 9, 1, 2);
            obj_sheet.SetValue(1, 9, "高损变");

            //3行标题内容
            obj_sheet.SetValue(2, 9, "台数(台)");
            obj_sheet.SetValue(2, 10, "比例(%)");
            //写标题列内容
            fc.Sheet_AddItem_FBonlyDY(obj_sheet, area_key_id, 3, obj_DY_List, SXareaid_List, XJareaid_List);
        }