Exemple #1
0
 private void Print_Click(object sender, EventArgs e)
 {
     try
     {
         this.dataGridView.Columns[0].Width = this.listView1.Columns[0].Width;
         this.dataGridView.Columns[1].Width = this.listView1.Columns[1].Width;
         this.dataGridView.Columns[2].Width = this.listView1.Columns[2].Width;
         this.dataGridView.Columns[3].Width = this.listView1.Columns[3].Width;
         this.dataGridView.Columns[4].Width = this.listView1.Columns[4].Width;
         this.dataGridView.Columns[5].Width = this.listView1.Columns[5].Width;
         this.dataGridView.Columns[6].Width = this.listView1.Columns[6].Width;
         List <PrinterItems> header = new List <PrinterItems>();
         List <PrinterItems> footer = new List <PrinterItems> {
             new PrinterItems("报告种类:编码导入          报告来源:文本文件 ", HorizontalAlignment.Left),
             new PrinterItems(string.Format("正确:{0}        无效:{1}       重复:{2}        失败:{3}       总计:{4}", new object[] { this.importResult.Correct, this.importResult.Invalid, this.importResult.Duplicated, this.importResult.Failed, this.importResult.Total }), HorizontalAlignment.Left),
             new PrinterItems("详细信息", HorizontalAlignment.Left),
             new PrinterItems("", HorizontalAlignment.Left)
         };
         DataGridPrintTools.Print(this.dataGridView, this.dataGridView.Parent, "编码导入报告", header, footer, true);
     }
     catch (Exception exception)
     {
         ExceptionHandler.HandleError(exception);
     }
 }
 public bool PrintTable(ref CustomStyleDataGrid dataGridView, string strTitle, List <PrinterItems> _PIHead, List <PrinterItems> _PIFoot)
 {
     try
     {
         return(DataGridPrintTools.Print(dataGridView, dataGridView.Parent, strTitle, _PIHead, _PIFoot, true));
     }
     catch (Exception exception)
     {
         ExceptionHandler.HandleError(exception);
         return(false);
     }
 }
Exemple #3
0
 private void tool_daying_Click(object sender, EventArgs e)
 {
     DataGridPrintTools.Print(this.customStyleDataGrid1, this, "统计结果打印", null, null, true);
 }
 public void Print(string string_0, object object_0, List <PrinterItems> header, List <PrinterItems> footer, bool bool_2, bool bool_3)
 {
     this.ilog_0.Debug("数据打印开始执行。");
     DataGridPrintTools.Print(bool_3, this, object_0, string_0, header, footer, bool_2);
     this.ilog_0.Debug("数据打印结束执行。");
 }