Visual Basic.NET - Imprime paginas sin salto de hoja

 
Vista:
sin imagen de perfil
Val: 4
Ha aumentado su posición en 15 puestos en Visual Basic.NET (en relación al último mes)
Gráfica de Visual Basic.NET

Imprime paginas sin salto de hoja

Publicado por Adolfo (6 intervenciones) el 01/01/2011 22:15:48
Buenas noches, El problema que tengo es que al imprimir un informes, junta (machaca) en una sola hoja
el contenido de varias, para mas aclaración envio el código

Public Sub ImprimirElementosCurso(ByVal e As System.Drawing.Printing.PrintPageEventArgs)
Dim TPen As New System.Drawing.Pen(System.Drawing.Color.Black, 1)

Dim Guardo As Double
Dim SoloBajas As Double
Dim O As Double
Dim Co As Double
SoloBajas = 0

For O = 0 To 499
TablaObservaciones(O) = ""
Next O
Obs = 0
Co = 0

For O = 0 To 299
If T01(O) <> "" And T12(O) = "" Then
SoloBajas = SoloBajas + 1
End If
Next O
If SoloBajas = 0 Then GoTo NoHay

SoloBajas = 0
Num = 0
Hoja = 0
SumaValor = 0
SumaAmortizacion = 0
SumaAnterior = 0
SumaAcumulado = 0
SumaValorNeto = 0
SumaVenta = 0

Lineo = 135

Cabecera:

Cabecera(e)

Linea = 140
If Hoja > 1 Then

e.Graphics.DrawString("Suma anterior...........", New Font("Arial", 8, FontStyle.Regular), Brushes.Black, 370, Linea)
ImprimirTotales(e)
Linea = Linea + 15
End If
Otro:
If T01(Num) = "" Then GoTo Final

If T12(Num) <> "" Then GoTo Sumo1

If NumLinea >= 40 Then GoTo Salto

SumaValor = SumaValor + Format(T06(Num), "###,##0.000")
SumaAmortizacion = SumaAmortizacion + Format(T08(Num), "###,##0.000")
SumaAnterior = SumaAnterior + Format(T09(Num), "###,##0.000")
SumaAcumulado = SumaAcumulado + Format(T10(Num), "###,##0.000")
SumaValorNeto = SumaValorNeto + Format(T11(Num), "###,##0.000")
SumaVenta = SumaVenta + Format(T13(Num), "###,##0.000")

e.Graphics.DrawString(T02(Num), New Font("Arial", 8, FontStyle.Regular), Brushes.Black, 13, Linea) 'Fecha Compra
e.Graphics.DrawString(T03(Num), New Font("Arial", 8, FontStyle.Regular), Brushes.Black, 85, Linea) 'Fecha Funcionamineto
e.Graphics.DrawString(Mid(T04(Num), 1, 50), New Font("Arial", 8, FontStyle.Regular), Brushes.Black, 160, Linea) 'Nomenclatura del Elemento
e.Graphics.DrawString(T12(Num), New Font("Arial", 8, FontStyle.Regular), Brushes.Black, 980, Linea) 'Fecha de Baja

'Valor Baja
FilaLista = 1124
CantidadInicial = Format(T13(Num), "###,##0.000")
Formateo(e)

'Valor Neto
FilaLista = 970
CantidadInicial = Format(T11(Num), "###,##0.000")
Formateo(e)

'Valor Amortización Acumulada
FilaLista = 890
CantidadInicial = Format(T10(Num), "###,##0.000")
Formateo(e)

'Valor Amortización Anterior
FilaLista = 790
CantidadInicial = Format(T09(Num), "###,##0.000")
Formateo(e)

'Valor Amortización Anual
FilaLista = 690
CantidadInicial = Format(T10(Num), "###,##0.000")
Formateo(e)

'Valor Porcentaje deAmortizacion
FilaLista = 590
CantidadInicial = Format(T07(Num), "Standard")
Formateo(e)

'Valor del Elemento
FilaLista = 552
CantidadInicial = Format(T06(Num), "###,##0.000")
Formateo(e)
Linea = Linea + 15
NumLinea = NumLinea + 1
Sumo1:
Num = Num + 1
GoTo Otro

Salto:
Guardo = Num
Linea = Linea + 5
e.Graphics.DrawString("Suma y sigue ...........", New Font("Arial", 8, FontStyle.Regular), Brushes.Black, 370, Linea)
ImprimirTotales(e)
Linea = Linea + 5
LineasVerticales(e)
NumLinea = 0
e.HasMorePages = True

Num = Guardo
GoTo Cabecera

Final:
e.HasMorePages = False
LineasVerticales(e)
Linea = Linea + 15
e.Graphics.DrawString("Total .......................", New Font("Arial", 8, FontStyle.Regular), Brushes.Black, 370, Linea)
ImprimirTotales(e)
Linea = Linea + 15
e.Graphics.DrawLine(TPen, 370, Linea, 1130, Linea) 'Linea Horizontal
Linea = Linea + 5
e.Graphics.DrawLine(TPen, 370, Linea, 1130, Linea) 'Linea Horizontal

NoHay:

End Sub
Un saludo Adolfo
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil
Val: 4
Ha aumentado su posición en 15 puestos en Visual Basic.NET (en relación al último mes)
Gráfica de Visual Basic.NET

RE:Imprime paginas sin salto de hoja

Publicado por Adolfo (6 intervenciones) el 17/01/2011 12:04:57
Ya encontre la solución:

Public Sub ImprimirElementosCurso(ByVal e As System.Drawing.Printing.PrintPageEventArgs)
Dim TPen As New System.Drawing.Pen(System.Drawing.Color.Black, 1)

Dim Guardo As Double

Lineo = 135

Cabecera:

Cabecera(e)

Linea = 140
If Hoja > 1 Then

e.Graphics.DrawString("Suma anterior...........", New Font("Arial", 8, FontStyle.Regular), Brushes.Black, 370, Linea)
ImprimirTotales(e)
Linea = Linea + 15
End If
Otro:
If T01(Num) = "" Then GoTo Final

If T12(Num) <> "" Then GoTo Sumo1

If NumLinea >= 40 Then GoTo Salto

SumaValor = SumaValor + Format(T06(Num), "###,##0.000")
SumaAmortizacion = SumaAmortizacion + Format(T08(Num), "###,##0.000")
SumaAnterior = SumaAnterior + Format(T09(Num), "###,##0.000")
SumaAcumulado = SumaAcumulado + Format(T10(Num), "###,##0.000")
SumaValorNeto = SumaValorNeto + Format(T11(Num), "###,##0.000")
SumaVenta = SumaVenta + Format(T13(Num), "###,##0.000")

e.Graphics.DrawString(T02(Num), New Font("Arial", 8, FontStyle.Regular), Brushes.Black, 13, Linea) 'Fecha Compra
e.Graphics.DrawString(T03(Num), New Font("Arial", 8, FontStyle.Regular), Brushes.Black, 85, Linea) 'Fecha Funcionamineto
e.Graphics.DrawString(Mid(T04(Num), 1, 50), New Font("Arial", 8, FontStyle.Regular), Brushes.Black, 160, Linea) 'Nomenclatura del Elemento
e.Graphics.DrawString(T12(Num), New Font("Arial", 8, FontStyle.Regular), Brushes.Black, 980, Linea) 'Fecha de Baja

'Valor Baja
FilaLista = 1124
CantidadInicial = Format(T13(Num), "###,##0.000")
Formateo(e)

'Valor Neto
FilaLista = 970
CantidadInicial = Format(T11(Num), "###,##0.000")
Formateo(e)

'Valor Amortización Acumulada
FilaLista = 890
CantidadInicial = Format(T10(Num), "###,##0.000")
Formateo(e)

'Valor Amortización Anterior
FilaLista = 790
CantidadInicial = Format(T09(Num), "###,##0.000")
Formateo(e)

'Valor Amortización Anual
FilaLista = 690
CantidadInicial = Format(T08(Num), "###,##0.000")
Formateo(e)

'Valor Porcentaje deAmortizacion
FilaLista = 590
CantidadInicial = Format(T07(Num), "Standard")
Formateo(e)

'Valor del Elemento
FilaLista = 552
CantidadInicial = Format(T06(Num), "###,##0.000")
Formateo(e)

If Len(T05(Num)) <> 0 Then
Linea = Linea + 10
e.Graphics.DrawString(T05(Num), New Font("Arial", 6, FontStyle.Regular), Brushes.Black, 160, Linea) ' Observaciones
Linea = Linea + 10
Else
Linea = Linea + 15
End If

NumLinea = NumLinea + 1
Sumo1:
Num = Num + 1
GoTo Otro

Salto:
Guardo = Num
Linea = Linea + 5
e.Graphics.DrawString("Suma y sigue ...........", New Font("Arial", 8, FontStyle.Regular), Brushes.Black, 370, Linea)
ImprimirTotales(e)
Linea = Linea + 5
LineasVerticales(e)
NumLinea = 0
e.HasMorePages = True

Num = Guardo
GoTo NoHay ' antes tenia Goto Cabecera

Final:
e.HasMorePages = False
LineasVerticales(e)
Linea = Linea + 15
e.Graphics.DrawString("Total .......................", New Font("Arial", 8, FontStyle.Regular), Brushes.Black, 370, Linea)
ImprimirTotales(e)
Linea = Linea + 15
e.Graphics.DrawLine(TPen, 370, Linea, 1130, Linea) 'Linea Horizontal
Linea = Linea + 5
e.Graphics.DrawLine(TPen, 370, Linea, 1130, Linea) 'Linea Horizontal

NoHay:

End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar