Mas agora estou tentando fazer com que os dados que não couberam na primeira pagina vão para segunda ... Efim até não existir + dados a serem exibidos no PrintDocument.
Private Sub PrintDocument5_BeginPrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs) Handles PrintDocument5.BeginPrint
Dim base As New Class_Relatorio_Parte
array5 = base.relatorio_Parte()
final = array5.Count - 1
paginas = Math.Ceiling(final / dpp)
End Sub
Private Sub PrintDocument5_EndPrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs) Handles PrintDocument5.EndPrint
array5 = Nothing
End Sub
Private Sub PrintDocument5_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument5.PrintPage
'Cadastro de Partes'
Dim modelagem As New Class_Parte_relatorio
'VER EM QUAL REGISTRO IRÁ EXIBIR
Dim i As Integer = 0
Dim g As Graphics = e.Graphics
Dim FonteCabecalho As New Font("Verdana", 15, System.Drawing.GraphicsUnit.Point)
Dim FonteTexto As New Font("Arial", 10, System.Drawing.GraphicsUnit.Point)
Dim FonteTextoBold As New Font("Arial", 10, FontStyle.Bold, System.Drawing.GraphicsUnit.Point)
Dim FonteParte As New Font("Arial", 8, System.Drawing.GraphicsUnit.Point)
Question
WesSouza
Opa tudo Certo pessoal?
Recebi muita ajuda daqui sobre Array..
Mas agora estou tentando fazer com que os dados que não couberam na primeira pagina vão para segunda ... Efim até não existir + dados a serem exibidos no PrintDocument.
Estou utilizando a seguinte programação.
http://social.microsoft.com/Forums/getfile/40385/
Dim array5 As New ArrayList
Dim itemAtual As Integer = 0
Dim final As Integer
Dim paginas As Integer
Dim dpp As Integer = 7
Private Sub PrintDocument5_BeginPrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs) Handles PrintDocument5.BeginPrint
Dim base As New Class_Relatorio_Parte
array5 = base.relatorio_Parte()
final = array5.Count - 1
paginas = Math.Ceiling(final / dpp)
End Sub
Private Sub PrintDocument5_EndPrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs) Handles PrintDocument5.EndPrint
array5 = Nothing
End Sub
Private Sub PrintDocument5_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument5.PrintPage
'Cadastro de Partes'
Dim modelagem As New Class_Parte_relatorio
'VER EM QUAL REGISTRO IRÁ EXIBIR
Dim i As Integer = 0
Dim g As Graphics = e.Graphics
Dim FonteCabecalho As New Font("Verdana", 15, System.Drawing.GraphicsUnit.Point)
Dim FonteTexto As New Font("Arial", 10, System.Drawing.GraphicsUnit.Point)
Dim FonteTextoBold As New Font("Arial", 10, FontStyle.Bold, System.Drawing.GraphicsUnit.Point)
Dim FonteParte As New Font("Arial", 8, System.Drawing.GraphicsUnit.Point)
g.DrawImage(Global.Sistema_Juridico.My.Resources.Resources.rodape, 80, 30)
While i < dpp
modelagem = array5(itemAtual)
g.DrawString("Nome:", FonteTextoBold, Brushes.Black, 80, 200 + i * 100)
g.DrawString(modelagem.nome, FonteTexto, Brushes.Black, 190, 200 + i * 100)
g.DrawString("Cod:", FonteTextoBold, Brushes.Black, 80, 220 + i * 100)
g.DrawString(modelagem.id, FonteTexto, Brushes.Black, 250, 220 + i * 100)
g.DrawString("CPF/CNPJ:", FonteTextoBold, Brushes.Black, 80, 240 + i * 100)
g.DrawString(modelagem.cpf_cnpj, FonteTexto, Brushes.Black, 230, 240 + i * 100)
g.DrawString("Endereço:", FonteTextoBold, Brushes.Black, 80, 260 + i * 100)
g.DrawString(modelagem.endereco, FonteTexto, Brushes.Black, 250, 260 + i * 100)
'CONTADOR +1 - PRÒXIMO REGISTRO
itemAtual += itemAtual
i += i
If itemAtual = final Then
Exit While
End If
End While
If itemAtual < final Then
e.HasMorePages = True
Else
e.HasMorePages = False
End If
End Sub
Assim Ele exibi um Erro : Generico de GDI +
Edited by WesSouzaLink to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.