preview com fwh1204 (RESOLVIDO)

preview com fwh1204 (RESOLVIDO)

Postby Sistem » Thu Jun 21, 2012 6:08 pm

depois da atualizacao para fivewin 1204 o preview mostra assim:
Image

se compilo com aversao anteiro mostra correto

que tenho q fazer?
Last edited by Sistem on Fri Jun 22, 2012 10:26 pm, edited 1 time in total.
FWH2008 | xHarbour | BCC74 | SQLRDD
User avatar
Sistem
 
Posts: 226
Joined: Sun May 13, 2012 7:52 am

Re: preview com fwh1204 (tprint)

Postby Antonio Linares » Thu Jun 21, 2012 7:54 pm

Por favor muestra el código que usas para imprimir, gracias
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: preview com fwh1204 (tprint)

Postby Sistem » Fri Jun 22, 2012 9:31 am

Antonio o codigo é esse abaixo:
Code: Select all  Expand view  RUN
#include "FiveWin.ch"

#define DMPAPER_A4   9    // A4 210 x 297 mm

Function RPed06()
    Local oPrn, oFont1, oFont2, oFont3, oFont4, oPen4, nRecno := Pedm->(Recno()),;
          nRowStep, nColStep, prow, pcol, cText, cLine, nFor, nLines,;
          Start := .t., TotalBru:=0, TotalLiq:=0, TotalDes:=0, TotalIpi:=0,;
          TotBru:=0, TotLiq:=0, TotDes:=0, TotIpi:=0, nQtd_Pedi:=0, nIten:=0, nPag:= 1

    PRINT oPrn NAME "ESPELHO PEDIDO VENDA" PREVIEW

    DEFINE FONT oFont1 NAME "ARIAL" SIZE 0,-08 OF oPrn
    DEFINE FONT oFont2 NAME "ARIAL" SIZE 0,-08 BOLD OF oPrn
    DEFINE FONT oFont3 NAME "ARIAL" SIZE 0,-07 OF oPrn
    DEFINE FONT oFont4 NAME "ARIAL" SIZE 0,-09 BOLD OF oPrn
    DEFINE PEN oPen4  WIDTH 3  COLOR 000000 //3123123

    oPrn:SetPage(DMPAPER_A4)

    nRowStep = oPrn:nVertRes() / 60   // We want 60 rows
    nColStep = oPrn:nHorzRes() / 78   // We want 78 cols
    prow:=nRowStep
    pcol:=nColStep

    DbSelectArea("Pedi")
    dbSetRelation( "Prod", {|| Pedi->Fam_Pedi+Pedi->Pro_Pedi} )
         PAGE
         CAJAROUND_(0.5, 0.5, 20.5, 2.7, 150, 150, oPrn, oPen4)
         CAJAROUND_(0.5, 2.7, 20.5, 4.7, 150, 150, oPrn, oPen4)
//         CAJAROUND_(0.5, 4.7, 20.5, 5.5, 150, 150, oPrn, oPen4)
         CAJAROUND_(0.5, 24.7, 20.5, 28.5, 150, 150, oPrn, oPen4)

         prow+=nRowStep
         oPrn:Say( prow, PCol*003, "ESPELHO PEDIDO DE VENDA"+Iif(Empr->Nem_Empr, "  -  "+Empr->Nom_Empr, ""), oFont4)
         oPrn:Say( prow, pcol*57, "EM: "+dtoc(date())+' - '+time()+"  PAG: "+Alltrim(Str(nPag)), oFont2)
         prow+=nRowStep
         oPrn:Say( prow, PCol*003, "PEDIDO: "+Alltrim(Pedm->Cod_Pedm)+"-"+Pedm->Ser_Pedm+" SIT: "+Pedm->Sta_Pedm+"  "+" EMISSÃO: "+DtoC(Pedm->Dat_Pedm), oFont2)
         prow+=nRowStep
         oPrn:Say( prow, PCol*003, "FORMA PAGM.: "+Cond->Cod_Cond+"-"+Alltrim(Cond->Nom_Cond)+"    REPR.: "+Vend->Cod_Vend+"-"+Alltrim(Vend->APe_Vend)+"    TRANSP.: "+Tran->Cod_Tran+"-"+Tran->Nom_Tran, oFont2)
         prow+=nRowStep
         prow+=nRowStep
         oPrn:Say( prow, PCol*003, "CLIENTE: "+Clie->Cod_Clie+" - "+Clie->Nom_Clie, oFont1)
         prow+=nRowStep
         oPrn:Say( prow, PCol*003, "END.: "+Alltrim(Clie->End_clie)+" "+Alltrim(Clie->Nmr_clie)+" "+Alltrim(Clie->Cmp_clie)+"  "+Clie->Bai_Clie+"MUNICIPIO: "+Alltrim(Clie->Cid_Clie)+" - UF: "+Clie->Est_Clie+"  C.E.P.: "+Clie->Cep_Clie, oFont1)
         prow+=nRowStep
         oPrn:Say( prow, PCol*003, Iif(Clie->Pfj_Clie, "CPF: ","CNPJ: ")+Iif(Clie->Pfj_Clie, Clie->Cpf_Clie, Clie->Cgc_Clie)+Space(08)+Iif(Clie->Pfj_Clie, "RG: ", "INS.EST.: ")+Iif(Clie->Pfj_Clie, Clie->Ide_Clie, Clie->Ins_Clie), oFont1)
         prow+=nRowStep
         prow+=nRowStep
         oPrn:Say( prow, PCol*003, "ITEN  GR-CÓD.           DESCRIÇÃO PRODUTO", oFont1)
         oPrn:Say( prow, PCol*043, "MD", oFont1)
         oPrn:Say( prow, PCol*047, "QTD.", oFont1)
         oPrn:Say( prow, PCol*052, "PREÇO", oFont1)
         oPrn:Say( prow, PCol*057, "DESC.", oFont1)
         oPrn:Say( prow, PCol*063, "IPI", oFont1)
         oPrn:Say( prow, PCol*069, "TOTAL", oFont1)
         prow+=nRowStep
         prow+=nRowStep
         Pedi->(DbSeek(Pedm->Cod_Pedm))
         While !Pedi->(Eof()) .and. Pedi->Cod_Pedi = Pedm->Cod_Pedm
               TotBru = (Pedi->Qtd_Pedi*Pedi->Prc_Pedi)
               TotDes = (pedi->qtd_Pedi*Pedi->Prc_Pedi*pedi->Des_Pedi/100)
               TotIpi = (Pedi->Qtd_Pedi*Pedi->Prc_Pedi*Pedi->Ipi_Pedi/100)-((Pedi->Qtd_Pedi*Pedi->Prc_Pedi*Pedi->Ipi_Pedi/100)*Pedi->Des_Pedi/100)
               TotLiq = TotBru - Totdes + TotIpi
               nIten=nIten+1
               oPrn:Say(prow, PCol*004, StrZero(nIten,2,0), oFont1)
               oPrn:Say(prow, PCol*006, Prod->Fam_Prod+"-"+Prod->Cod_Prod+"       "+Prod->Nom_Prod, oFont3)
               oPrn:Say(prow, PCol*043, Prod->Uni_Prod, oFont1)
               oPrn:Say(prow, PCol*049, Tran(Pedi->Qtd_Pedi,"9999999"), oFont1,,,, 1)
               oPrn:Say(prow, PCol*055, Tran(Pedi->Prc_Pedi,"@E 999,999.99"), oFont1,,,, 1)
               oPrn:Say(prow, PCol*060, Tran(TotDes,"@E 999,999.99"), oFont1,,,, 1)
               oPrn:Say(prow, PCol*065, Tran(TotIpi,"@E 999,999.99"), oFont1,,,, 1)
               oPrn:Say(prow, PCol*072, Tran(TotLiq,"@E 999,999.99"), oFont1,,,, 1)
               TotalBru = TotalBru + (Pedi->Qtd_Pedi*Pedi->Prc_Pedi)
               TotalDes = TotalDes + (pedi->qtd_Pedi*Pedi->Prc_Pedi*pedi->Des_Pedi/100)
               TotalIpi = TotalIpi + (Pedi->Qtd_Pedi*Pedi->Prc_Pedi*Pedi->Ipi_Pedi/100)-((Pedi->Qtd_Pedi*Pedi->Prc_Pedi*Pedi->Ipi_Pedi/100)*Pedi->Des_Pedi/100)
               nQtd_Pedi=nQtd_Pedi+Pedi->Qtd_Pedi
               If !Empty(Pedi->Obm_Pedi)
                       cText := Pedi->Obm_Pedi
                       nLines := MlCount(Alltrim(cText), 70)
                       FOR nFor := 1 TO nLines
                           cLine := MemoLine(Alltrim(cText), 70, nFor)
                           prow+=nRowStep
                           oPrn:Say(prow, PCol*006, cLine, oFont3)
                       NEXT
               Endif
               prow+=nRowStep

               Pedi->(dbskip())

               If prow>nRowStep*47
                  prow := 1
                  nPag++
                  oPrn:EndPage()
                  oPrn:StartPage()
                  CAJAROUND_(0.5, 0.3, 20.5, 1.4, 150, 150, oPrn, oPen4)
                  CAJAROUND_(0.5, 1.4, 20.5, 1.9, 150, 150, oPrn, oPen4)
                  CAJAROUND_(0.5, 24.7, 20.5, 28.5, 150, 150, oPrn, oPen4)
                  prow+=nRowStep
                  oPrn:Say( prow, PCol*003, "ESPELHO PEDIDO DE VENDA  -  "+Alltrim(Empr->Nom_Empr), oFont4)
                  oPrn:Say( prow, pcol*057, "EM: "+dtoc(date())+' - '+time()+"  PAG: "+Alltrim(Str(nPag)), oFont2)
                  prow+=nRowStep
                  oPrn:Say( prow, PCol*003, "PEDIDO: "+Alltrim(Pedm->Cod_Pedm)+"-"+Pedm->Ser_Pedm+" SIT: "+Pedm->Sta_Pedm+"  "+" EMISSÃO: "+DtoC(Pedm->Dat_Pedm), oFont2)
                  prow+=nRowStep
                  oPrn:Say( prow, PCol*003, "ITEN  GR-CÓD.           DESCRIÇÃO PRODUTO", oFont1)
                  oPrn:Say( prow, PCol*043, "MD", oFont1)
                  oPrn:Say( prow, PCol*047, "QTD.", oFont1)
                  oPrn:Say( prow, PCol*052, "PREÇO", oFont1)
                  oPrn:Say( prow, PCol*057, "DESC.", oFont1)
                  oPrn:Say( prow, PCol*063, "IPI", oFont1)
                  oPrn:Say( prow, PCol*069, "TOTAL", oFont1)
                  prow+=nRowStep
                  prow+=nRowStep
               Endif
         End

   TotalLiq = TotalBru - Totaldes + TotalIpi
//   oPrn:Say( (nRowStep*48)-nIten, Pcol*3, Repl('_', 124), oFont1)
   oPrn:Say( (nRowStep*49)-nIten, Pcol*003, "TOTAL DO PEDIDO", oFont1)
   oPrn:Say( (nRowStep*49)-nIten, Pcol*049, Tran(nQtd_Pedi, "9999999"), oFont1,,,, 1)
   oPrn:Say( (nRowStep*49)-nIten, Pcol*060, Tran(TotalDes, "@E 999,999.99"), oFont1,,,, 1)
   oPrn:Say( (nRowStep*49)-nIten, Pcol*065, Tran(TotalIpi, "@E 999,999.99"), oFont1,,,, 1)
   oPrn:Say( (nRowStep*49)-nIten, Pcol*072, Tran(TotalLiq, "@E 999,999.99"), oFont1,,,, 1)
     cText := Pedm->Obs_Pedm
     nLines := MlCount(Alltrim(cText),115)
     FOR nFor := 1 TO nLines
         cLine := MemoLine(Alltrim(cText), 115, nFor)
         oPrn:Say((nRowStep*(50+nFor))-nIten, PCol*003, cLine, oFont3)
     NEXT
   oPrn:EndPage()

   ENDPRINT
   oFont1:End()
   oFont2:End()
   oFont3:End()
   oFont4:End()

   dbClearRelation()
   DbSelectArea("Pedm")

Return nil
 


obs: com rpreview.prg da FWH1111 mostra CORRETO
FWH2008 | xHarbour | BCC74 | SQLRDD
User avatar
Sistem
 
Posts: 226
Joined: Sun May 13, 2012 7:52 am

Re: preview com fwh1204 (tprint)

Postby Antonio Linares » Fri Jun 22, 2012 2:15 pm

Por favor cambia esta línea y comprueba el resultado:

nRowStep = oPrn:nVertRes() / 60

cambia 60 por 50, ó 40, y veamos como afecta al resultado
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: preview com fwh1204 (tprint)

Postby Sistem » Fri Jun 22, 2012 5:52 pm

Antonio

não obtive sucesso... aparentemente exibiu da mesma maneira :(
FWH2008 | xHarbour | BCC74 | SQLRDD
User avatar
Sistem
 
Posts: 226
Joined: Sun May 13, 2012 7:52 am

Re: preview com fwh1204 (tprint)

Postby Bayron » Fri Jun 22, 2012 7:13 pm

Despues de remover gran parte del codigo ya que no colocaste las DBF, compiló correctamente...

Image
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: preview com fwh1204 (RESOLVED)

Postby Sistem » Fri Jun 22, 2012 8:26 pm

com o codigo abaixo:
Code: Select all  Expand view  RUN

#include "FiveWin.ch"

Function RPed06()
    Local oPrn, oFont1, oFont2, oFont3, oFont4, oPen4, nRecno := Pedm->(Recno()),;
          nRowStep, nColStep, prow, pcol, cText, cLine, nFor, nLines,;
          Start := .t., TotalBru:=0, TotalLiq:=0, TotalDes:=0, TotalIpi:=0,;
          TotBru:=0, TotLiq:=0, TotDes:=0, TotIpi:=0, nQtd_Pedi:=0, nIten:=0, nPag:= 1

    PRINT oPrn NAME "ESPELHO PEDIDO VENDA" PREVIEW

    DEFINE FONT oFont1 NAME "ARIAL" SIZE 0,-08 OF oPrn
    DEFINE FONT oFont2 NAME "ARIAL" SIZE 0,-08 BOLD OF oPrn
    DEFINE FONT oFont3 NAME "ARIAL" SIZE 0,-07 OF oPrn
    DEFINE FONT oFont4 NAME "ARIAL" SIZE 0,-09 BOLD OF oPrn

      nRowStep = oPrn:nVertRes() / 60   // We want 60 rows
    nColStep = oPrn:nHorzRes() / 78   // We want 78 cols
    prow:=nRowStep
    pcol:=nColStep
       PAGE
         prow+=nRowStep
         oPrn:Say( prow, pcol*003, "ESPELHO PEDIDO DE VENDA", oFont4)
         oPrn:Say( prow, pcol*057, "EM: TESTE ETSTE TESTE", oFont2)
         prow+=nRowStep
         oPrn:Say( prow, PCol*003, "PEDIDO TESTEEEEEEEEEEEEEEEEEE", oFont2)
         prow+=nRowStep
         oPrn:Say( prow, PCol*003, "FORMA PAGM.: TESTE TESTE", oFont2)
         prow+=nRowStep
         prow+=nRowStep
         oPrn:Say( prow, PCol*003, "CLIENTE: TETSTE ETSTE ETSTE TESTE", oFont1)
         prow+=nRowStep
         oPrn:Say( prow, PCol*003, "END.: TESTE ETSTE ETSTE ETSTE ", oFont1)
         prow+=nRowStep
         oPrn:Say( prow, PCol*003, "testeg fgf g sdf gdfgdsfgfdsgdsfgdsfgdsfgdf ", oFont1)

         oPrn:EndPage()

       ENDPRINT

Return nil
 


resulta:

Image

com fwh1111 e anterioras trabalha normal.

qual exemplo da pasta \samples posso compilar para comparar?
Last edited by Sistem on Fri Jun 22, 2012 10:23 pm, edited 1 time in total.
FWH2008 | xHarbour | BCC74 | SQLRDD
User avatar
Sistem
 
Posts: 226
Joined: Sun May 13, 2012 7:52 am

Re: preview com fwh1204 (tprint)

Postby Antonio Linares » Fri Jun 22, 2012 8:43 pm

Please place this call before:

MsgInfo( oPrn:nVertRes() )
nRowStep = oPrn:nVertRes() / 60 // We want 60 rows

so we know the vertical resolution of the printer
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: preview com fwh1204 (tprint)

Postby Sistem » Fri Jun 22, 2012 8:56 pm

antonio MsgInfo( oPrn:nVertRes() ) = 7016
and

rpreview.prg <=> previous version returns the same value = 7016
FWH2008 | xHarbour | BCC74 | SQLRDD
User avatar
Sistem
 
Posts: 226
Joined: Sun May 13, 2012 7:52 am

Re: preview com fwh1204 (tprint)

Postby Sistem » Fri Jun 22, 2012 10:22 pm

RESOLVIDO

na linha 1377 do rpreview.prg fwh1204
Code: Select all  Expand view  RUN

before
   if ! ::lZoom .and. ! lInit
        ::Zoom( .T. )   // A.L. 08 Oct 2007
   endif

after

   if ! ::lZoom .and. ! lInit
//        ::Zoom( .T. )   // A.L. 08 Oct 2007    <= essa linha foi comentada
   endif
 


thank you all
FWH2008 | xHarbour | BCC74 | SQLRDD
User avatar
Sistem
 
Posts: 226
Joined: Sun May 13, 2012 7:52 am

Re: preview com fwh1204 (RESOLVIDO)

Postby Antonio Linares » Sat Jun 23, 2012 9:51 am

Muy bien. gracias :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to All products support

Who is online

Users browsing this forum: No registered users and 4 guests