USUÁRIO:      SENHA:        SALVAR LOGIN ?    Adicione o VBWEB na sua lista de favoritos   Fale conosco 

 

  Fórum

  Visual Basic
Voltar
Autor Assunto:  Imprimindo pelo método Print....
ChicoVieira
CRUZEIRO
SP - BRASIL
Postada em 23/12/2006 20:44 hs            
Olá.
Num project, tenho um relatório feito no Print, onde são listados alguns campos de uma tabela Access. Como tudo no Print é feito "na raça" (no código), algum "expert" poderia me dizer como eu intercalo uma linha pontilhada sob cada registro da tabela, no relatório, para separar os registros da tabela, como se faz facilmente no Crystal?
Nº      Título                     Diretor                 Ator principal
-------------------------------------------------------------------
0488F A doce vida             Frederico Fellini     Marcello Mastroiani
-------------------------------------------------------------------
0489G A Missão                 Roland Joffé         Jeremy Irons
-------------------------------------------------------------------
Eis o código de impressão:
Dim ll As Byte
Dim pag As Byte
pag = 0
ll = 60
TbCadFilmes.Index = "IndNome"   'Muda o índex para ordenar a lista pelo nome.
Printer.FontName = "Times New Roman" 'declarar fonte desejada
Printer.Orientation = 1 'onde 1=retrato e 2=paisagem
Printer.PaperSize = 1
Printer.ScaleMode = 5
'Printer.FontSize = 10 'tamanho da fonte
On Error Resume Next
Do While Not TbCadFilmes.EOF
    If ll >= 60 Then
        Printer.Print 'linha em branco
        Printer.Print
        pag = pag + 1
        Printer.FontSize = 13
        Printer.FontBold = True
        Printer.Print Tab(6); "Relação do acervo de filmes em DVD";
        Printer.FontSize = 9
        Printer.FontBold = False
        Printer.Print
        Printer.Print
        Printer.Print Tab(30); "Data: " + CStr(Date); Tab(110); "Pág.: " + Str(pag)
        'printer.print tab("Pág.: " + Str(pag)
        Printer.Print Tab(10); String(110, "_")
        Printer.Print
        Printer.Print Tab(10); "Listagem de filmes ordenada por título"
        Printer.Print Tab(10); String(110, "_")
        Printer.Print
        Printer.Print Tab(10); "Nº";                  'Cabeçalho da coluna
        Printer.Print Tab(20); "Título";              'Idem
        Printer.Print Tab(80); "Diretor";             'Idem
        Printer.Print Tab(110); "Ator principal";   'Idem
        Printer.Print Tab(10); String(110, "_")
        Printer.Print
        ll = 8
     End If
    
     Printer.Print Tab(10); TbCadFilmes!NúmerodaFita;   'Campo do registro
     Printer.Print Tab(20); TbCadFilmes!NomedoFilme;    'Idem
     Printer.Print Tab(80); TbCadFilmes!Diretor;            'Idem
     Printer.Print Tab(110); TbCadFilmes!Atorprincipal;   'Idem
     ll = ll + 1
     TbCadFilmes.MoveNext
     If ll = 60 Then
        Printer.Print Tab(12); String(42, "_"); Spc(2); " continua "; Spc(2); String(42, "_")
        Printer.NewPage 'jogar numa próxima pagina
     End If
Loop
    Printer.EndDoc     
 
Obrigado.
     
Vilmar Brazão
Pontos: 2843
SAO PAULO
SP - BRASIL
Postada em 29/01/2007 17:26 hs         
Tente usar este cód. abaixo de onde será a separação:
Print String(20, "-"), onde:

Function String(Number As Long, Character)
    Member of VBA.Strings
    Returns a repeating character string of the length specified
 
Espero que ajude ;)

http://www.vilmarbro.com.br
     
claudio.barto
não registrado
Postada em 29/01/2007 18:18 hs   
   Printer.Print Tab(10); TbCadFilmes!NúmerodaFita;   'Campo do registro
   Printer.Print Tab(20); TbCadFilmes!NomedoFilme;    'Idem
   Printer.Print Tab(80); TbCadFilmes!Diretor;            'Idem
   Printer.Print Tab(110); TbCadFilmes!Atorprincipal;   'Idem
   ll = ll + 1
'nova linha
   Printer.Print Tab(10); String(110, "_")
   ll = ll + 1

 
     
ChicoVieira
CRUZEIRO
SP - BRASIL
Postada em 29/01/2007 18:23 hs            
Valeu, moçada. Muito obrigado. Vou implementar...
     
Página(s): 1/1    


Seu Nome:

Seu eMail:

ALTERAR PARA MODO HTML
Mensagem:

[:)] = 
[:P] = 
[:(] = 
[;)] = 

HTML DESLIGADO

     
 VOLTAR

  



CyberWEB Network Ltda.    © Copyright 2000-2025   -   Todos os direitos reservados.
Powered by HostingZone - A melhor hospedagem para seu site
Topo da página