void PrintDocument_PrintPage(object sender, PrintPageEventArgs e) { PrinterSettings settings = (sender as PrintDocument).PrinterSettings; //传入打印机的右上可打印区 Point point = new Point(Attributes.Margin.Left - Convert.ToInt32(PrintUtil.PrintDocument.DefaultPageSettings.PrintableArea.Left), Attributes.Margin.Top - Convert.ToInt32(PrintUtil.PrintDocument.DefaultPageSettings.PrintableArea.Top)); printPageIndex++; if (settings.PrintRange == PrintRange.SomePages && (printPageIndex < settings.FromPage || printPageIndex > settings.ToPage)) { e.Cancel = true; return; } //批量打印如设置编页,则报表的位置参数不为0 e.Graphics.Clear(Color.White); //学习版水印处理 PrintUtil.PrintWatermark(e.Graphics, this); drawManager.Draw(new IGraphics(e.Graphics), point, printPageIndex); if (printPageIndex >= TatalPage || (settings.PrintRange == PrintRange.SomePages && printPageIndex == settings.ToPage + 1)) { e.HasMorePages = false; } else { e.HasMorePages = true; } }
internal bool Print() { if (batchSet.ShowDialog() == DialogResult.OK) { if (PrintUtil.ShowPrintDlg(batchSet.PrintListData.ProjectPDF) == DialogResult.OK) { backgroundWorker.RunWorkerAsync(""); return(true); } } return(false); }
private void printPage_Click(object sender, EventArgs e) { if (PrintUtil.ShowPrintDlg() == DialogResult.OK) { if (report.ProjectDataManager != null) { report.MutliProjectPrint(); } else { report.Print(); } } }
public void print_Click(object sender, EventArgs e) { if (curReport != null) { if (curReport.IsDoc) { //打印WORD格式报表 ReportHelper.PrintWord(curReport.DocPath, curReport.Data.MacorsVerbCollection); } else { PrintUtil.ShowPrintDlg(); curReport.InitReportData(this.projectDataManager, 0); curReport.MutliProjectPrint(); } } }