public override bool CreatePrintingTable() { int rows = this.GetTotalRows(); int cols = this.GetTotalColumns(); if (rows == 0 || cols == 0) { return(false); } this.PrintingTable = new WebbTable(rows, cols); this.SetValues(); Int32Collection indicators = new Int32Collection(); StyleBuilder.StyleRowsInfo m_StyleInfo = new Styles.StyleBuilder.StyleRowsInfo(indicators, indicators, indicators, false, true); StyleBuilder styleBuilder = new StyleBuilder(); styleBuilder.BuildStyle(this.PrintingTable, m_StyleInfo, null, this.Styles, new Int32Collection()); this.PrintingTable.AutoAdjustSize(this.ExControl.CreateGraphics(), false, true); this.PrintingTable.SetNoWrap(); if (this.AdjustWidth) { this.ApplyColumnWidthStyle(cols); } return(true); }
/// <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); }
private bool CreateMatrixPrintingTable() { if (MatrixInfo == null || !_HaveData || this.RootGroupInfo == null) { this.PrintingTable = null; return(false); } int m_Rows = MatrixInfo.GetMatrixGroupedRows(this); if (this.TableHeaders != null && this.TableHeaders.RowCount > 0 && this.TableHeaders.ColCount > 0) //2008-8-29 9:12:31@simon { m_Rows += this.TableHeaders.RowCount; //2008-8-29 9:12:37@simon } int m_Column = MatrixInfo.GetMatrixGroupedColumns(this.ShowRowIndicators); if (m_Rows <= 0 || m_Column <= 0) { this.PrintingTable = null; return(false); } System.Diagnostics.Debug.WriteLine(string.Format("Begin Create print table:{0}X{1}", m_Rows, m_Column)); this.PrintingTable = new WebbTable(m_Rows, m_Column); MatrixInfo.SetMatrixColumnWidthAtFirst(this.PrintingTable, this.ShowRowIndicators); //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(); #region Modify codes at 2008-11-4 15:45:04@Simon styleBuilder.BuildMatrixGroupStyle(this.PrintingTable, m_StyleInfo, this.MatrixInfo, this.Styles, ignoreRows); if (this.TableHeaders != null && this.TableHeaders.RowCount > 0 && this.TableHeaders.ColCount > 0) //Added this code at 2008-11-6 10:22:40@Simon { int minh = 0; int i_Titleindex = 0; if (this.HeaderRows.Count > 0) { foreach (int tl in this.HeaderRows) { if (i_Titleindex < tl) { i_Titleindex = tl; } } } if (i_Titleindex > minh) { foreach (int col in this.TableHeaders.ColsToMerge) { IWebbTableCell Mergedcell = PrintingTable.GetCell(i_Titleindex, col); this.PrintingTable.MergeCells(minh, i_Titleindex, col, col); IWebbTableCell bordercell = PrintingTable.GetCell(minh, col); if (this.HaveHeader) { bordercell.Text = Mergedcell.Text; bordercell.CellStyle.StringFormat = Mergedcell.CellStyle.StringFormat; if ((bordercell.CellStyle.StringFormat & StringFormatFlags.DirectionVertical) != 0) { bordercell.CellStyle.HorzAlignment = HorzAlignment.Far; bordercell.CellStyle.VertAlignment = VertAlignment.Center; } } } } } if (this.TableHeaders != null) { this.TableHeaders.SetHeadGridLine(this.PrintingTable, this.HeaderRows); } #endregion //End Modify this.ApplyColumnWidthStyle(m_Column); this.ApplyRowHeightStyle(m_Rows); switch (this.CellSizeAutoAdapting) { case CellSizeAutoAdaptingTypes.NotUse: break; case CellSizeAutoAdaptingTypes.WordWrap: this.PrintingTable.AutoAdjustMatrixSize(this.ExControl.CreateGraphics(), true, false, this.MatrixInfo, this.ShowRowIndicators); break; case CellSizeAutoAdaptingTypes.OneLine: this.PrintingTable.AutoAdjustMatrixSize(this.ExControl.CreateGraphics(), false, false, this.MatrixInfo, this.ShowRowIndicators); break; } System.Diagnostics.Debug.WriteLine("Create print table completely"); return(true); }
/// <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); }