Alain da Silva Posted July 11, 2016 Report Share Posted July 11, 2016 Bom dia, como resolver o problema com relatórios desconfigurados, em um cliente com a impressora laser hp jetpro aparece desse jeito, na minha máquina aparece normal. #include "FiveWin.ch" #include "Utilprn.ch" #include "CORES.ch" FUNCTION RELCLI() LOCAL OPRN,oUtil Local OBRUSH Local nColor := CINZACL IF VERIFICAIMP() ELSE RETURN(.F.) ENDIF PRINTER OPRN NAME "RELATORIO DE CLIENTE" preview MODAL *----------------------------------------------------------- OPRN:SETPAGE(9) DEFINE FONT oFnt0 NAME "Arial" SIZE 0,-6 OF OPRN DEFINE FONT oFnt0B NAME "Arial" SIZE 0,-6 BOLD OF OPRN DEFINE FONT oFnt8 NAME "Arial" SIZE 0,-8 OF OPRN DEFINE FONT oFnt8B NAME "Arial" SIZE 0,-8 BOLD OF OPRN DEFINE FONT oFnt10 NAME "Arial" SIZE 0,-10 OF OPRN DEFINE FONT oFNT3 NAME "Times New Roman" SIZE 0, -8 OF oPrn DEFINE FONT oFNT4 NAME "Times New Roman" SIZE 0, -10 BOLD OF oPrn DEFINE FONT oFNT5 NAME "Times New Roman" SIZE 0, -14 BOLD OF oPrn DEFINE FONT oFNT6 NAME "Times New Roman" SIZE 0, -16 BOLD OF oPrn DEFINE FONT fTitulo NAME "Times New Roman" SIZE 0,-17 OF OPRN DEFINE FONT fExpandido NAME "Arial" SIZE 0,-12 OF OPRN DEFINE FONT fNormal6 NAME "Arial" SIZE 0,-6 OF OPRN DEFINE FONT fNormal8 NAME "Arial" SIZE 0,-8 OF OPRN DEFINE FONT fNormal9 NAME "Arial" SIZE 0,-9 OF OPRN DEFINE FONT fNormal10 NAME "Arial" SIZE 0,-10 OF OPRN DEFINE PEN oPen WIDTH 3 COLOR CLR_BLACK DEFINE PEN oPen2 WIDTH 3 COLOR CLR_WHITE DEFINE UTILPRN oUtil PEN oPen OF oPrn DEFINE BRUSH OBRUSH COLOR nColor *----------------------------------------------------------- PAG := 1 BEGIN SEQUENCE CABECALHO("RELATÓRIO DE CLIENTE","",OPRN,PAG,oUtil) XLN:=3.5 LN:=3.5 sele 1 dbsetorder(2) ARQCLI->(dbgotop()) DO WHILE !ARQCLI->(EOF()) UTILPRN OUTIL XLN,1 SAY ARQCLI->RAZAO FONT ofnt4 UTILPRN OUTIL XLN,20.2 SAY ARQCLI->TELEFONE FONT ofnt4 right XLN := XLN + 0.4 UTILPRN oUtil XLN,1 SAY ALLTRIM(ARQCLI->ENDERECO)+" , "+ALLTRIM(ARQCLI->NUMERO)+" , "+ALLTRIM(ARQCLI->BAIRRO) FONT ofnT4 XLN := XLN + 0.4 UTILPRN oUtil XLN,1 SAY ARQCLI->CGCCLI+" - I.E."+IIF(ALLTRIM(ARQCLI->INSCEST)<>" ",ARQCLI->INSCEST,"I.E. ISENTO") FONT ofnT4 XLN := XLN + 0.4 UTILPRN oUtil XLN,1 SAY ALLTRIM(ARQCLI->CIDADE)+"/"+ARQCLI->ESTADO+" - CEP "+ARQCLI->CEPCLI FONT ofnT4 UTILPRN oUtil BOX XLN+.5,0.5 TO XLN+.5+.01,20.2 PEN oPen XLN := XLN + 0.7 LN := LN + 5 IF LN >= 65 PULAPAGINA(@LN,"RELATÓRIO DE CLIENTE",,@PAG,@XLN,OPRN,OUTIL,,65) ENDIF SELE 1 ARQCLI->(DBSKIP()) UNLOCK ENDDO END SEQUENCE ENDPAGE ENDPRINT OUTIL:END() OPEN:END() OFNT0:END() OFNT0B:END() oFnt8:END() oFnt8B:END() oFnt10:END() OFNT3:END() OFNT4:END() OFNT5:END() OFNT6:END() OPRN:END() OPEN:END() OPEN2:END() CURSORARROW() RETURN NIL Quote Link to comment Share on other sites More sharing options...
joaosolution Posted July 11, 2016 Report Share Posted July 11, 2016 Alain Bom dia Isso é um erro no preview somente ou quando você imprime também sai desconfigurado? Att João Bosco Quote Link to comment Share on other sites More sharing options...
Alain da Silva Posted July 11, 2016 Author Report Share Posted July 11, 2016 cara, agora vc me pegou. Sabe que eu não cheguei a imprimir o relatório. Só visualizei no preview e agora também não tenho como testar. Mas pode acontecer de mostrar um tamanho grande no preview e na impressão sair certo? Quote Link to comment Share on other sites More sharing options...
kapiaba Posted July 11, 2016 Report Share Posted July 11, 2016 /* Use: nRowStep = oPrn:nVertRes() / 20 // We want 20 rows nColStep = oPrn:nHorzRes() / 15 // We want 15 cols Para imprimir em qualquer impressora. */ // Sample showing how to manage the printer object #include "FiveWin.ch" static oWnd //----------------------------------------------------------------------------// function Main() local oPrn, oFont local nRowStep, nColStep local nRow := 0, nCol := 0, n, m // PrnSetSize( 2100, 1200 ) To adjust a different printer paper size! PRINT oPrn NAME "Testing the printer object from FiveWin" PREVIEW if Empty( oPrn:hDC ) return nil // Printer was not installed or ready endif DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 0, -12 OF oPrn nRowStep = oPrn:nVertRes() / 20 // We want 20 rows nColStep = oPrn:nHorzRes() / 15 // We want 15 cols PAGE oPrn:SayBitmap( 1, 1, "..\bitmaps\fivewin.bmp" ) for n = 1 to 20 // rows nCol = 0 oPrn:Say( nRow, nCol, Str( n, 2 ), oFont ) nCol += nColStep for m = 1 to 15 oPrn:Say( nRow, nCol, "+", oFont ) nCol += nColStep next nRow += nRowStep next oPrn:Line( 0, 0, nRow, nCol ) ENDPAGE PAGE nRow = 0 oPrn:SayBitmap( 1, 1, "..\bitmaps\fivewin.bmp" ) for n = 1 to 20 // rows nCol = 0 oPrn:Say( nRow, nCol, Str( n + 20, 2 ), oFont ) nCol += nColStep for m = 1 to 15 oPrn:Say( nRow, nCol, "+", oFont ) nCol += nColStep next nRow += nRowStep next oPrn:Line( 0, 0, nRow, nCol ) ENDPAGE ENDPRINT oFont:End() // Destroy the font object return nil Quote Link to comment Share on other sites More sharing options...
joaosolution Posted July 11, 2016 Report Share Posted July 11, 2016 Alain Bom dia Sim as vezes acontece de no preview estar distorcido e na impressão sai OK. Pelo menos comigo já aconteu isso. Att João Bosco Quote Link to comment Share on other sites More sharing options...
Alain da Silva Posted July 11, 2016 Author Report Share Posted July 11, 2016 kapiaba, isso se aplica também no caso do relatório mostrar uma letra muito maior do que o normal? veja na imagem que o tamanho da página esta normal somente o tamanho dos fontes. kapiaba 1 Quote Link to comment Share on other sites More sharing options...
ram_bh Posted July 11, 2016 Report Share Posted July 11, 2016 Alain, Eu sempre uso da forma como o Kapiaba mostrou. O tamanho da fonte deve ser alterado em função do número de colunas. Eu costumo usar uma fonte sem micro espacejamento. Para Retrato e A4 eu uso 66 linhas por página. Define Font oFntPrn Name "Lucida Console" Size 0,-9 Of oPrn oPrn:SetPortrait() // retrato oPrn:SetPage(9) // A4 nCStep := oPrn:nHorzRes() / 102 // colunas nRStep := oPrn:nVertRes() / 66 // linhas Um abraço! Rodrigo Melo kapiaba 1 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted July 11, 2016 Report Share Posted July 11, 2016 O Alain, está absolutamente correto, vá na dele. Quote Link to comment Share on other sites More sharing options...
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.