Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/06/2009, 23:56
merol999
 
Fecha de Ingreso: junio-2009
Mensajes: 2
Antigüedad: 14 años, 11 meses
Puntos: 0
ayuda con impresion en vb.net

pues tengo un problema con la impresion en vb.net, como utilizo vastantes e.graphics las lineas de impresion se salen de la hoja y no puedo hacer que me las imprima en mas de una hoja, pues aqui esta mi codigo

Código:
ev.Graphics.DrawString("__________________________________________________________________________________________________________", New Font("calibri", 10, FontStyle.Bold), Brushes.Black, 50, ypos)
            ypos += lineHeight
            ev.Graphics.DrawString("PADECIMIENTO ACTUAL POR PROBLEMAS", New Font("calibri", 15, FontStyle.Bold), Brushes.Black, 235, ypos)
            ypos += lineHeight
            ev.Graphics.DrawString("__________________________________________________________________________________________________________", New Font("calibri", 10, FontStyle.Bold), Brushes.Black, 50, ypos)
            ypos += lineHeight
            nuevo += 3
            While indiceproblemas < contproblemas

                If seleccionador = 1 Then
                    If cargarproblemas(indiceproblemas, 0) <> "" Then
                        ev.Graphics.DrawString("P " & contador & ": " & cargarproblemas(indiceproblemas, 0) & "", prfont, Brushes.Black, 70, ypos)
                        ypos += lineHeight
                        ypos += lineHeight
                        ypos += lineHeight
                        nuevo += 3

                    End If
                End If
                If seleccionador = 2 Then
                    If cargarproblemas(indiceproblemas, 1) <> "" Then
                        ev.Graphics.DrawString("S: " & cargarproblemas(indiceproblemas, 1) & "", prfont, Brushes.Black, 80, ypos)
                        ypos += lineHeight
                        ypos += lineHeight
                        ypos += lineHeight
                        nuevo += 3

                    End If
                End If
                If seleccionador = 3 Then
                    If cargarproblemas(indiceproblemas, 2) <> "" Then
                        ev.Graphics.DrawString("O: " & cargarproblemas(indiceproblemas, 2) & "", prfont, Brushes.Black, 80, ypos)
                        ypos += lineHeight
                        ypos += lineHeight
                        ypos += lineHeight
                        nuevo += 3

                    End If
                End If
                If seleccionador = 4 Then
                    If cargarproblemas(indiceproblemas, 3) <> "" Then
                        ev.Graphics.DrawString("A: " & cargarproblemas(indiceproblemas, 3) & "", prfont, Brushes.Black, 80, ypos)
                        ypos += lineHeight
                        ypos += lineHeight
                        ypos += lineHeight
                        nuevo += 3

                    End If
                End If
                If seleccionador = 5 Then
                    If cargarproblemas(indiceproblemas, 4) <> "" Then
                        ev.Graphics.DrawString("P: " & cargarproblemas(indiceproblemas, 4) & "", prfont, Brushes.Black, 80, ypos)
                        ypos += lineHeight
                        ypos += lineHeight
                        ypos += lineHeight
                        ypos += lineHeight
                        nuevo += 3
                        seleccionador = 0
                        indiceproblemas += 1
                        contador += 1
                    Else
                        seleccionador = 0
                        indiceproblemas += 1
                        contador += 1
                    End If
                End If

                If nuevo = 48 Then
                    seleccionador += 1
                    ev.HasMorePages = False
                    nuevo = 0
                    Exit Sub
                End If
                seleccionador += 1
            End While


                ypos += lineHeight
                ev.Graphics.DrawString("__________________________________________________________________________________________________________", New Font("calibri", 10, FontStyle.Bold), Brushes.Black, 50, ypos)
                ypos += lineHeight
                ev.Graphics.DrawString("EXAMEN FISICO", New Font("calibri", 15, FontStyle.Bold), Brushes.Black, 340, ypos)
                ypos += lineHeight
                ev.Graphics.DrawString("__________________________________________________________________________________________________________", New Font("calibri", 10, FontStyle.Bold), Brushes.Black, 50, ypos)
                ypos += lineHeight
                ev.Graphics.DrawString("Examen fisico:", prfont, Brushes.Black, 70, ypos)
                ypos += lineHeight
                ev.Graphics.DrawString(" " & examenfisico & " ", prfont, Brushes.Black, 70, ypos)
                ypos += lineHeight
                ypos += lineHeight
                ypos += lineHeight
                ypos += lineHeight
                ypos += lineHeight
                ypos += lineHeight
                examenimpreso = True
                nuevo += 11
 ev.Graphics.DrawString("Laboratoprios o estudios previos: ", prfont, Brushes.Black, 70, ypos)
                ypos += lineHeight
                ev.Graphics.DrawString("" & laboratorios & "", prfont, Brushes.Black, 70, ypos)
                ypos += lineHeight
                ypos += lineHeight
                ypos += lineHeight
                ypos += lineHeight
                ypos += lineHeight
                ypos += lineHeight
                ypos += lineHeight
                estudiosimpreso = True
                nuevo += 8

ev.Graphics.DrawString("__________________________________________________________________________________________________________", New Font("calibri", 10, FontStyle.Bold), Brushes.Black, 50, ypos)
                ypos += lineHeight
                ev.Graphics.DrawString("DIAGNOSTICOS", New Font("calibri", 15, FontStyle.Bold), Brushes.Black, 350, ypos)
                ypos += lineHeight
                ev.Graphics.DrawString("__________________________________________________________________________________________________________", New Font("calibri", 10, FontStyle.Bold), Brushes.Black, 50, ypos)
                ypos += lineHeight
                ypos += lineHeight
                nuevo += 3
                While indicediagnosticos < contdiagnosticos
                    ev.Graphics.DrawString("Diagnostico " & indicemas & ": " & cargardiagnosticos(indicediagnosticos, 0) & "", prfont, Brushes.Black, 70, ypos)
                    ypos += lineHeight
                    ypos += lineHeight
                    nuevo += 2
                    If nuevo >= 48 Then
                        nuevo = 0
                        ev.HasMorePages = False
                        Exit Sub
                    End If
                    indicediagnosticos += 1
                    indicemas += 1
                End While
tengo que aclarar que este no es el codigo completo, pero no cupo todo en el mensage, perro lo que falta es identico al primer while, la variable nuevo es un contador de lineas de un intento fallido de querer hacer el salto pero no funciono, si alguien tiene una respuesta, codigo similar me gustaria que me ayudaran, si es mejor con un ejemplo, pero bueno, cuanquier ayuda es valiosa, de antemano muchas gracias.