1
« en: Lunes 11 de Marzo de 2013, 03:28 »
Hola!
Resulta Que uso este codigo y no funciona es para imprimir
El error que me da dice que no se pudo encontrar la columna ID, los parametros son Columname
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim ce = Me.PinturasDataGridView.CurrentCell.RowIndex
e.Graphics.DrawString(Me.PinturasDataGridView.Item(Me.DataGridViewTextBoxColumn1.HeaderText, ce).Value.ToString, SystemFonts.DefaultFont, Brushes.Black, 200, 200)
Dim ce1 = Me.PinturasDataGridView.CurrentCell.RowIndex
e.Graphics.DrawString(Me.PinturasDataGridView.Item(Me.DataGridViewTextBoxColumn2.HeaderText, ce1).Value.ToString, SystemFonts.DefaultFont, Brushes.Black, 250, 200)
Dim ce2 = Me.PinturasDataGridView.CurrentCell.RowIndex
e.Graphics.DrawString(Me.PinturasDataGridView.Item(Me.DataGridViewTextBoxColumn3.HeaderText, ce2).Value.ToString, SystemFonts.DefaultFont, Brushes.Black, 300, 200)
Dim ce3 = Me.PinturasDataGridView.CurrentCell.RowIndex
e.Graphics.DrawString(Me.PinturasDataGridView.Item(Me.DataGridViewTextBoxColumn4.HeaderText, ce3).Value.ToString, SystemFonts.DefaultFont, Brushes.Black, 350, 200)
Dim ce4 = Me.PinturasDataGridView.CurrentCell.RowIndex
e.Graphics.DrawString(Me.PinturasDataGridView.Item(Me.DataGridViewTextBoxColumn5.HeaderText, ce4).Value.ToString, SystemFonts.DefaultFont, Brushes.Black, 400, 200)
Dim ce5 = Me.PinturasDataGridView.CurrentCell.RowIndex
e.Graphics.DrawString(Me.PinturasDataGridView.Item(Me.DataGridViewTextBoxColumn6.HeaderText, ce5).Value.ToString, SystemFonts.DefaultFont, Brushes.Black, 450, 200)
End Sub