コード例 #1
0
ファイル: CBaseReport.cs プロジェクト: pjamenaja/onixlegacy
        private void CreateDefaultHeader()
        {
            String    nm        = "";
            Thickness defMargin = new Thickness(3, 1, 3, 1);

            CColumn c0_0 = new CColumn(new Thickness(0, 0, 0, 0), new GridLength(50, GridUnitType.Star));

            c0_0.SetHorizontalAlignment(HorizontalAlignment.Left);

            CColumn c0_1 = new CColumn(new Thickness(0, 0, 0, 0), new GridLength(50, GridUnitType.Star));

            c0_1.SetHorizontalAlignment(HorizontalAlignment.Right);

            nm = "GLB_HEADER_LEVEL0";

            CRow h0 = new CRow(nm, 20, 2, defMargin);

            h0.SetFont(null, FontStyles.Normal, 10, FontWeights.Normal);
            h0.AddColumn(c0_0);
            h0.AddColumn(c0_1);
            rowdef[nm] = h0;

            CColumn c1_0 = new CColumn(new Thickness(0, 0, 0, 0), new GridLength(100, GridUnitType.Star));

            nm = "GLB_HEADER_LEVEL1";
            CRow h1 = new CRow(nm, 30, 1, defMargin);

            h1.SetFont(null, FontStyles.Normal, 0, FontWeights.Bold);
            h1.AddColumn(c1_0);
            rowdef[nm] = h1;

            CColumn c1_2 = new CColumn(new Thickness(0, 0, 0, 0), new GridLength(100, GridUnitType.Star));

            nm = "GLB_HEADER_PARAM";
            CRow h2 = new CRow(nm, 30, 1, defMargin);

            h2.SetFont(null, FontStyles.Normal, 0, FontWeights.Bold);
            h2.AddColumn(c1_2);
            rowdef[nm] = h2;
        }
コード例 #2
0
ファイル: CBaseReport.cs プロジェクト: pjamenaja/onixlegacy
        protected void configRow(String group, CRow row, String rowType)
        {
            ArrayList arr = (ArrayList)reportConfigHash[group];
            int       cnt = arr.Count;
            int       i   = 0;

            foreach (CReportColConfig cc in arr)
            {
                Thickness tck = new Thickness(0.5, 0.5, 0, 0.5);
                if (i == cnt - 1)
                {
                    tck = new Thickness(0.5, 0.5, 0.5, 0.5);
                }

                HorizontalAlignment al = HorizontalAlignment.Left;
                if (rowType.Equals("H"))
                {
                    al = cc.HeaderAlighment;
                }
                else if (rowType.Equals("B"))
                {
                    al = cc.BodyAlighment;
                }
                else if (rowType.Equals("F"))
                {
                    al = cc.FooterAlighment;
                }

                CColumn c = new CColumn(tck, new GridLength(cc.ColumnWidth, GridUnitType.Star));
                c.SetHorizontalAlignment(al);
                c.SetDataType(cc.DataType);

                row.AddColumn(c);

                i++;
            }

            excel.AddRowTemplate(row);
        }