Salto de Pagina Imprimir Dato Siguiente

Holas que tal, mi situacion es esta:
Quiero imprimir los datos con salto de pagina pero necesito que corte los datos donde se acaba el margen y precisamente donde se quedo, que empieze a esecribir en la nueva pagina.
En efecto me hace una nueva pagina, pero, me empieza a ezcribir desde donde empieza el registro, y no donde se quedo. Es decir, Cada registro consta de varios renglones, necesito que me imprima el renglon en que se quedo, no el registro en que no se completo.
Mi codigo es el siguiente:
While linea_a_imprimir < G_Origen.Rows.Count
y += 2
Dim rnumpago As New Rectangle
Tw_Const = 4
If rnumpago.Y > 745 Then
Tw_Const = 4
y = e.MarginBounds.Top
e.HasMorePages = True
Exit Sub
End If
e.Graphics.DrawString("Numero:", fuente14bold, Brushes.Black, x, y)
rnumpago.X = x + 30
rnumpago.Y = y + Tw_Const
rnumpago.Width = 60
rnumpago.Height = alto10
e.Graphics.DrawString(G_Origen.Rows(linea_a_imprimir).Cells("Numero").Value, fuente8, Brushes.Black, rnumpago, Formato)
e.Graphics.DrawString("Fecha_Solicitud:", fuente14bold, Brushes.Black, x + 100, y)
rnumpago.X = x + 220
rnumpago.Y = y + Tw_Const
rnumpago.Width = 90
rnumpago.Height = alto10
e.Graphics.DrawString(G_Origen.Rows(linea_a_imprimir).Cells("Fecha_Solicitud").Value, fuente8, Brushes.Black, rnumpago)
e.Graphics.DrawString("Fecha_Embarque:", fuente14bold, Brushes.Black, x + 315, y)
rnumpago.X = x + 445
rnumpago.Y = y + Tw_Const
rnumpago.Width = 90
rnumpago.Height = alto10
e.Graphics.DrawString(G_Origen.Rows(linea_a_imprimir).Cells("Fecha_Embarque").Value, fuente8, Brushes.Black, rnumpago)
e.Graphics.DrawString("Fecha_Descarga:", fuente14bold, Brushes.Black, x + 540, y)
rnumpago.X = x + 660
rnumpago.Y = y + Tw_Const
rnumpago.Width = 90
rnumpago.Height = alto10
e.Graphics.DrawString(G_Origen.Rows(linea_a_imprimir).Cells("Fecha_Descarga").Value, fuente8, Brushes.Black, rnumpago)
e.Graphics.DrawString("Carta Porte:", fuente14bold, Brushes.Black, x + 750, y)
rnumpago.X = x + 840
rnumpago.Y = y + Tw_Const
rnumpago.Height = alto10
rnumpago.Width = 50
e.Graphics.DrawString(G_Origen.Rows(linea_a_imprimir).Cells("Carta_Porte").Value, fuente8, Brushes.Black, rnumpago)
Tw_Const = Tw_Const + 20
If rnumpago.Y > 745 Then
Tw_Const = 4
'linea_a_imprimir = linea_a_imprimir
y = e.MarginBounds.Top
e.HasMorePages = True
Exit Sub
End If
e.Graphics.DrawString("Operador:", fuente14bold, Brushes.Black, x, y + 20)
rnumpago.X = x + 80
rnumpago.Y = y + Tw_Const
rnumpago.Height = alto10
rnumpago.Width = 100
e.Graphics.DrawString(G_Origen.Rows(linea_a_imprimir).Cells("Operador").Value, fuente8, Brushes.Black, rnumpago)
'e.Graphics.DrawString("Nombre:", fuente14bold, Brushes.Black, x + 180, y + 20)
rnumpago.X = x + 200
rnumpago.Y = y + Tw_Const
rnumpago.Height = alto10
rnumpago.Width = 300
Busca_Cat("OPERADOR", G_Origen.Rows(linea_a_imprimir).Cells("Operador").Value)
e.Graphics.DrawString(Res_Bus, fuente8, Brushes.Black, rnumpago)
e.Graphics.DrawLine(pincel05, x + 80, y + Tw_Const + alto10, x + 500, y + Tw_Const + alto10)
e.Graphics.DrawString("Producto:", fuente14bold, Brushes.Black, x + 505, y + 20)
rnumpago.X = x + 580
rnumpago.Y = y + Tw_Const
rnumpago.Height = alto10
rnumpago.Width = 100
e.Graphics.DrawString(G_Origen.Rows(linea_a_imprimir).Cells("Producto").Value, fuente8, Brushes.Black, rnumpago)
' e.Graphics.DrawString("Descripcion:", fuente14bold, Brushes.Black, x + 670, y + 20)
rnumpago.X = x + 680
rnumpago.Y = y + Tw_Const
rnumpago.Height = alto10
rnumpago.Width = 250
Busca_Cat("PRODUCTO", G_Origen.Rows(linea_a_imprimir).Cells("Producto").Value)
e.Graphics.DrawString(Res_Bus, fuente8, Brushes.Black, rnumpago)
e.Graphics.DrawLine(pincel05, x + 580, y + Tw_Const + alto10, x + 930, y + Tw_Const + alto10)
Tw_Const = Tw_Const + 20
If rnumpago.Y > 745 Then
Tw_Const = 4
y = e.MarginBounds.Top
'y = 89
e.HasMorePages = True
Exit Sub
End If
e.Graphics.DrawString("Cliente:", fuente14bold, Brushes.Black, x, y + 40)
rnumpago.X = x + 70
rnumpago.Y = y + Tw_Const
rnumpago.Height = alto10
rnumpago.Width = 40
e.Graphics.DrawString(G_Origen.Rows(linea_a_imprimir).Cells("Cliente").Value, fuente8, Brushes.Black, rnumpago, Formato)
' e.Graphics.DrawString("Descripcion:", fuente14bold, Brushes.Black, x + 95, y + 40)
rnumpago.X = x + 130
rnumpago.Y = y + Tw_Const
rnumpago.Height = alto10
rnumpago.Width = 250
Busca_Cat("CLIENTES", G_Origen.Rows(linea_a_imprimir).Cells("Cliente").Value)
e.Graphics.DrawString(Res_Bus, fuente8, Brushes.Black, rnumpago)
e.Graphics.DrawLine(pincel05, x + 80, y + Tw_Const + alto10, x + 380, y + Tw_Const + alto10)
e.Graphics.DrawString("Ruta:", fuente14bold, Brushes.Black, x + 385, y + 44)
rnumpago.X = x + 435
rnumpago.Y = y + Tw_Const
rnumpago.Height = alto10
rnumpago.Width = 40
e.Graphics.DrawString(G_Origen.Rows(linea_a_imprimir).Cells("Ruta").Value, fuente8, Brushes.Black, rnumpago, Formato)
rnumpago.X = x + 495
rnumpago.Y = y + Tw_Const
rnumpago.Height = alto10
rnumpago.Width = 250
Busca_Cat("RUTA", G_Origen.Rows(linea_a_imprimir).Cells("ruta").Value)
e.Graphics.DrawString(Res_Bus, fuente8, Brushes.Black, rnumpago)
e.Graphics.DrawLine(pincel05, x + 435, y + Tw_Const + alto10, x + 845, y + Tw_Const + alto10)
Tw_Const = Tw_Const + 20
If rnumpago.Y > 745 Then
'y = 69 :
Tw_Const = 4
y = e.MarginBounds.Top
e.HasMorePages = True
Exit Sub
End If
e.Graphics.DrawString("Origen:", fuente14bold, Brushes.Black, x, y + 60)
rnumpago.X = x + 70
rnumpago.Y = y + Tw_Const
rnumpago.Height = alto10
rnumpago.Width = 40
e.Graphics.DrawString(G_Origen.Rows(linea_a_imprimir).Cells("Origen").Value, fuente8, Brushes.Black, rnumpago, Formato)
rnumpago.X = x + 130
rnumpago.Y = y + Tw_Const
rnumpago.Height = alto10
rnumpago.Width = 150
Busca_Cat("ORIGEN", G_Origen.Rows(linea_a_imprimir).Cells("Origen").Value)
e.Graphics.DrawString(Res_Bus, fuente8, Brushes.Black, rnumpago)
e.Graphics.DrawLine(pincel05, x + 80, y + Tw_Const + alto10, x + 280, y + Tw_Const + alto10)
e.Graphics.DrawString("Destino:", fuente14bold, Brushes.Black, x + 285, y + 60)
rnumpago.X = x + 345
rnumpago.Y = y + Tw_Const
rnumpago.Height = alto10
rnumpago.Width = 40
e.Graphics.DrawString(G_Origen.Rows(linea_a_imprimir).Cells("Destino").Value, fuente8, Brushes.Black, rnumpago, Formato)
rnumpago.X = x + 405
rnumpago.Y = y + Tw_Const
rnumpago.Height = alto10
rnumpago.Width = 150
Busca_Cat("Destino", G_Origen.Rows(linea_a_imprimir).Cells("Destino").Value)
e.Graphics.DrawString(Res_Bus, fuente8, Brushes.Black, rnumpago)
e.Graphics.DrawLine(pincel05, x + 340, y + Tw_Const + alto10, x + 555, y + Tw_Const + alto10)
e.Graphics.DrawString("Remisin:", fuente14bold, Brushes.Black, x + 560, y + 60)
rnumpago.X = x + 620
rnumpago.Y = y + Tw_Const
rnumpago.Height = alto10
rnumpago.Width =...

Añade tu respuesta

Haz clic para o