foreach (DataGridViewRow row in this.dataGridView1.Rows) { if (xx < 2) { e.HasMorePages = false; xx = xx + 1; } if (row.Cells[0].Value != null && xx>=2) { e.HasMorePages = true; if (xx % 3 == 0) { x = 40; y = 210; y2 = 256; } xx = xx + 1; if (xx == 4) xx = 0; } if (row.Cells[0].Value == null) e.HasMorePages = false; if (row.Cells[0].Value != null) { for (int j = this.dataGridView1.Columns.Count - 1; j > -1; j--) { if (j == 0) w = 70; else w = 0; DataGridViewCell cell; cell = row.Cells[j]; Rectangle rect = new Rectangle(x, y, cell.Size.Width + w, pictureBox3.Height ); } sf.LineAlignment = StringAlignment.Center; sf.Alignment = StringAlignment.Center; e.Graphics.DrawRectangle(Pens.Black, rect); ( if (cell.Value != null { e.Graphics.DrawString(cell.Value.ToString(), SystemFonts.DefaultFont, Brushes.Black, rect, sf); } x += rect.Width; } x = 40; y += pictureBox3.Height; } }
هیچ کاربری تا کنون از این پست تشکر نکرده است
با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)