public float Print(float intX, float intY, System.Drawing.Printing.PrintPageEventArgs e, int _lineHeight, int fullWidth, Font _lineFont) { float _ret = PrintTitle(intX, intY, e, _lineHeight, fullWidth, _lineFont); int _count = this.groupControl1.Controls.Count; for (int i = _count; i > 0; i--) { SinoSZUC_DetailLinecs _cs = this.groupControl1.Controls[i - 1] as SinoSZUC_DetailLinecs; _ret += _cs.Print(intX, intY + _ret, e, _lineHeight, fullWidth, _lineFont); } return(_ret); }
private void AddColumns() { this.Height = 40; this.groupControl1.Controls.Clear(); List <MDModel_Table_Column> _columnList = new List <MDModel_Table_Column>(); foreach (MDModel_Table_Column _tc in TableDefine.Columns) { if (_tc.ColumnDefine.TableColumn.CanDisplay && _tc.ColumnDefine.CanShowAsResult) { _columnList.Add(_tc); } } //排序 _columnList.Sort(new MDModel_ColumnComparer()); //显示 SinoSZUC_DetailLinecs _line = new SinoSZUC_DetailLinecs(); foreach (MDModel_Table_Column _tc in _columnList) { if (_tc.ColumnDefine.TableColumn.DisplayLength <= _line.BlankLength) { _line.AddItem(_tc, TableRecordData); } else { _line.Dock = DockStyle.Top; this.groupControl1.Controls.Add(_line); this.Height += _line.Height; _lineCount++; _line.BringToFront(); _line = new SinoSZUC_DetailLinecs(); _line.AddItem(_tc, TableRecordData); } } if (_line.BlankLength < 2) { _line.Dock = DockStyle.Top; this.groupControl1.Controls.Add(_line); this.Height += _line.Height; _lineCount++; _line.BringToFront(); } }
public string ExportHtml() { StringBuilder _sb = new StringBuilder(); //导出标题 string _titleStr = this.groupControl1.Text.Trim(); _sb.Append("<tr>\n"); _sb.Append("<td colspan=4 style='background:#99CCFF;'>"); _sb.Append(HttpUtility.HtmlEncode(_titleStr)); _sb.Append("</td>"); _sb.Append("</tr>"); //导出记录 int _count = this.groupControl1.Controls.Count; for (int i = _count; i > 0; i--) { SinoSZUC_DetailLinecs _cs = this.groupControl1.Controls[i - 1] as SinoSZUC_DetailLinecs; _sb.Append(_cs.ExportHtml()); } return(_sb.ToString()); }