/// <summary>
        /// Create printing table
        /// </summary>
        /// <returns></returns>
        public override bool CreatePrintingTable()
        {
            if (this._RootGroupInfo == null)
            {
                return(false);
            }

            int m_Rows   = this.GetGroupedRows();
            int m_Column = this.GetGroupedColumns();

            if (m_Rows <= 0 || m_Column <= 0)
            {
                this.PrintingTable = null;
                return(false);
            }

            System.Diagnostics.Debug.WriteLine(string.Format("Create print table:{0}X{1}", m_Rows, m_Column));
            if (this.TopCount > 0 && m_Rows < this.TopCount)
            {
                m_Rows = this.TopCount;
            }
            this.PrintingTable = new WebbTable(m_Rows, m_Column);
            //Set value
            this.HeaderRows.Clear();
            this.SectionRows.Clear();
            this.TotalRows.Clear();
            this.BreakRows.Clear();
            this.ColumnStyleRows.Clear();

            this.SetTableValue();

            StyleBuilder.StyleRowsInfo m_StyleInfo = new Styles.StyleBuilder.StyleRowsInfo(this._HeaderRows, this._SectionRows, this._TotalRows, this.ShowRowIndicators, this.HaveHeader);

            Int32Collection ignoreRows = this.HeaderRows.Combine(this.HeaderRows, this.SectionRows, this.TotalRows);

            StyleBuilder styleBuilder = new StyleBuilder();

            styleBuilder.BuildGroupStyle(this.PrintingTable, m_StyleInfo, this.RootGroupInfo /*this.ColumnStyleRows*/, this.Styles, ignoreRows);        //Added this code at 2008-11-4 16:10:40@Simon

            this.ApplyColumnWidthStyle(m_Column);
            this.ApplyRowHeightStyle(m_Rows);
            switch (this.CellSizeAutoAdapting)
            {
            case CellSizeAutoAdaptingTypes.NotUse:
                break;

            case CellSizeAutoAdaptingTypes.WordWrap:
                this.PrintingTable.AutoAdjustSize(this.ExControl.CreateGraphics(), true, false);
                break;

            case CellSizeAutoAdaptingTypes.OneLine:
                this.PrintingTable.AutoAdjustSize(this.ExControl.CreateGraphics(), false, false);
                break;
            }

            if (this.TopCount <= 0)
            {
                this.PrintingTable.DeleteEmptyRows();
            }
            else
            {
                this.PrintingTable.DeleteExcrescentRows(this.TopCount /* + this.HeaderRows.Count*/);
            }

            System.Diagnostics.Debug.WriteLine("Create print table completely");

            return(true);
        }
示例#2
0
        /// <summary>
        /// Create printing table
        /// </summary>
        /// <returns></returns>
        public override bool CreatePrintingTable()
        {
            if (this._RootGroupInfo == null || !(this._RootGroupInfo is FieldGradingInfo))
            {
                return(false);
            }



            int m_Rows = this.GetGroupedRows();

            int m_Column = this.GetGroupedColumns();

            if (m_Rows <= 0 || m_Column <= 0)
            {
                this.PrintingTable = null;
                return(false);
            }

            System.Diagnostics.Debug.WriteLine(string.Format("Create print table:{0}X{1}", m_Rows, m_Column));

            #region Modify codes at 2009-4-8 11:04:18@Simon
            int RealTopCount = this.GetRealTopCount();

            if (RealTopCount > 0 && m_Rows < RealTopCount)
            {
                m_Rows = RealTopCount;
            }
            #endregion        //End Modify

            this.PrintingTable = new WebbTable(m_Rows, m_Column);
            //Set value
            this.HeaderRows.Clear();
            this.SectionRows.Clear();
            this.TotalRows.Clear();


            this.SetTableValue();

            StyleBuilder.StyleRowsInfo m_StyleInfo = new Styles.StyleBuilder.StyleRowsInfo(this._HeaderRows, this._SectionRows, this._TotalRows, this.ShowRowIndicators, this.HaveHeader);

            #region TopCount
            if (this.TopCount <= 0)
            {
                Int32Collection Rows = this.HeaderRows.Combine(HeaderRows, TotalRows);

                this.PrintingTable.DeleteEmptyRows(Rows, m_StyleInfo, this.ShowRowIndicators);
            }
            else
            {
                this.PrintingTable.DeleteExcrescentRows(RealTopCount);
            }

            m_Rows = this.PrintingTable.GetRows();

            if (m_Rows <= 0)
            {
                this.PrintingTable = null;
                return(false);
            }
            #endregion

            Int32Collection ignoreRows = this.HeaderRows.Combine(this.HeaderRows, this.SectionRows, this.TotalRows);

            StyleBuilder styleBuilder = new StyleBuilder();

            styleBuilder.BuildGroupStyle(this.PrintingTable, m_StyleInfo, this.RootGroupInfo, this.Styles, ignoreRows);

            this.AdjustHeaderStyle();

            this.ApplyColumnWidthStyle(m_Column);

            this.ApplyRowHeightStyle(m_Rows);

            switch (this.CellSizeAutoAdapting)
            {
            case CellSizeAutoAdaptingTypes.NotUse:
                break;

            case CellSizeAutoAdaptingTypes.WordWrap:
                this.PrintingTable.AutoAdjustSize(this.ExControl.CreateGraphics(), true, false);
                break;

            case CellSizeAutoAdaptingTypes.OneLine:
                this.PrintingTable.AutoAdjustSize(this.ExControl.CreateGraphics(), false, false);
                break;
            }

            this.OurBordersSetting.ChangeTableOutBorders(this.PrintingTable);

            System.Diagnostics.Debug.WriteLine("Create print table completely");

            return(true);
        }