private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { //true表示还有数据行没有打印完,则继续打 bool more = dataGridViewPrint.DrawDataGridView(e.Graphics); if (more == true) { e.HasMorePages = true; } }
private void printDoc_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { //true表示还有数据行没有打印完,则继续打 if (dp.DrawDataGridView(e.Graphics)) { //附加打印页 e.HasMorePages = true; } else { DataGridViewPrint.PageNumber = 0; DataGridViewPrint.mColumnPoints.Clear(); DataGridViewPrint.mColumPointsWidth.Clear(); } }