Jump to content
Fivewin Brasil

BullZip PDF (RESOLVIDO)


Helio_hbinfo

Recommended Posts

Boa Tarde a todos

Estou tentando usar o BULLZIP, e esta ocorrendo o seguinte erro.

Tenho que imprimir um DBF com numero pedido, cliente e itens.

O programa gera conteudo do relatorio correto, porem o nome do arquivo PDF eh gerado com o numero do segundo pedido.

O nome do arquivo PDF eh deslocado de 1 registro.

Alguem pode me ajudar?

Grato

Helio Tsuyama

Santo Andre - SP

fw12.01-xhb1.2.1-xDev0.7 - bcc 5.82

hbinfo.br@gmail.com

/////////////////////////////////////

FUNCTION Relat43() && Imprime Recibo

LOCAL oPrn, oFont, oFont1, oFont2, oFont3, oFont8, oFont9, oFont10, oFont11, oFont12

LOCAL oPrinter, oReport

LOCAL oBrush, oPen1, oPen2

LOCAL nlines, wlinha, i, cline

LOCAL wln, winc

LOCAL wFileWmf := "cessao.WMF" //"STD_INJ.EMF"

cPDF := "C:\TEMP\TESTEBULZIP.PDF"

nArea := Select()

cpdf_File := "C:\TEMP\TESTEBULZIP.PDF"

cpdf_file := wFilePdf + STRZERO(wdocumento,6,0) + ".PDF"

// initialize Bullzip PDF settings

************************************************************

oPdf := TOleAuto():New( "Bullzip.PDFPrinterSettings" )

oPdf:SetValue("Output",cpdf_File)

oPdf:SetValue("ConfirmOverwrite", "no")

oPdf:SetValue("ShowSaveAS", "never")

oPdf:SetValue("ShowSettings", "never")

oPdf:SetValue("ShowPDF", "no")

oPdf:SetValue("RememberLastFileName", "no")

oPdf:SetValue("RememberLastFolderName", "no")

oPdf:WriteSettings := .T.

PRINTER oPrn NAME "Gerandopdf" ;

to "Bullzip PDF Printer" //modal

DEFINE FONT oFont8 NAME "Arial" SIZE 0, -8 OF oPrn

DEFINE FONT oFont NAME "Arial" BOLD SIZE 0, -8 OF oPrn

DEFINE FONT oFont1 NAME "Arial" BOLD ITALIC SIZE 0,-20 OF oPrn

DEFINE FONT oFont2 NAME "Arial" BOLD ITALIC UNDERLINE SIZE 0, -8 OF oPrn

DEFINE FONT oFont3 NAME "Arial" BOLD SIZE 0,-11 OF oPrn

oPrn:StartPage()

oPrn:ImportWMF( wFileWmf )

wln := 3.3

winc := .404

oPrn:CmSay( wln, 19.0, TRANSFORM(wdocumento, "@E 999,999"), oFont3,,,2,1)

oPrn:CmSay( wln+(winc* 0.0), 12.0, wdata, oFont3)

wln := 4.23

oPrn:CmSay( wln+(winc* 1.0), 3.5, wrazao, oFont3)

wln := 7.50

IF !EMPTY(wfilme1)

oPrn:CmSay( wln+(winc* 1.0), 1.0, wfilme1, oFont3)

oPrn:CmSay( wln+(winc* 1.0), 13.5, TRANSFORM(wqdade1, "@E 999,999"), oFont3,,,2,1)

oPrn:CmSay( wln+(winc* 1.0), 16.5, TRANSFORM(wvalor1, "@E 999,999.99"), oFont3,,,2,1)

oPrn:CmSay( wln+(winc* 1.0), 20.0, TRANSFORM((wqdade1*wvalor1), "@E 999,999.99"), oFont3,,,2,1)

ENDIF

oPrn:CmSay( 23.40, 20.0, TRANSFORM(wTotal, "@E 999,999.99"), oFont3,,,2,1)

oPrn:EndPage()

SysWait(.5)

oFont8:end()

oFont:end()

oFont1:end()

oFont2:end()

oFont3:end()

ENDPRINTER

oPdf := NIL

RELEASE oPdf

RETURN(NIL)

Editado por - hinfo on 23/07/2012 18:49:42

Editado por - hinfo on 24/07/2012 09:42:56

Link to comment
Share on other sites

Boa Tarde a todos

Estou tentando usar o BULLZIP, e esta ocorrendo o seguinte erro.

Tenho que imprimir um DBF com numero pedido, cliente e itens.

O programa gera conteudo do relatorio correto, porem o nome do arquivo PDF eh gerado com o numero do segundo pedido.

O nome do arquivo PDF eh deslocado de 1 registro.

Alguem pode me ajudar?

Grato

Helio Tsuyama

Santo Andre - SP

fw12.01-xhb1.2.1-xDev0.7 - bcc 5.82

hbinfo.br@gmail.com

/////////////////////////////////////

FUNCTION Relat43() && Imprime Recibo

LOCAL oPrn, oFont, oFont1, oFont2, oFont3, oFont8, oFont9, oFont10, oFont11, oFont12

LOCAL oPrinter, oReport

LOCAL oBrush, oPen1, oPen2

LOCAL nlines, wlinha, i, cline

LOCAL wln, winc

LOCAL wFileWmf := "cessao.WMF" //"STD_INJ.EMF"

cPDF := "C:\TEMP\TESTEBULZIP.PDF"

nArea := Select()

cpdf_File := "C:\TEMP\TESTEBULZIP.PDF"

cpdf_file := wFilePdf + STRZERO(wdocumento,6,0) + ".PDF"

// initialize Bullzip PDF settings

************************************************************

oPdf := TOleAuto():New( "Bullzip.PDFPrinterSettings" )

oPdf:SetValue("Output",cpdf_File)

oPdf:SetValue("ConfirmOverwrite", "no")

oPdf:SetValue("ShowSaveAS", "never")

oPdf:SetValue("ShowSettings", "never")

oPdf:SetValue("ShowPDF", "no")

oPdf:SetValue("RememberLastFileName", "no")

oPdf:SetValue("RememberLastFolderName", "no")

oPdf:WriteSettings := .T.

PRINTER oPrn NAME "Gerandopdf" ;

to "Bullzip PDF Printer" //modal

DEFINE FONT oFont8 NAME "Arial" SIZE 0, -8 OF oPrn

DEFINE FONT oFont NAME "Arial" BOLD SIZE 0, -8 OF oPrn

DEFINE FONT oFont1 NAME "Arial" BOLD ITALIC SIZE 0,-20 OF oPrn

DEFINE FONT oFont2 NAME "Arial" BOLD ITALIC UNDERLINE SIZE 0, -8 OF oPrn

DEFINE FONT oFont3 NAME "Arial" BOLD SIZE 0,-11 OF oPrn

oPrn:StartPage()

oPrn:ImportWMF( wFileWmf )

wln := 3.3

winc := .404

oPrn:CmSay( wln, 19.0, TRANSFORM(wdocumento, "@E 999,999"), oFont3,,,2,1)

oPrn:CmSay( wln+(winc* 0.0), 12.0, wdata, oFont3)

wln := 4.23

oPrn:CmSay( wln+(winc* 1.0), 3.5, wrazao, oFont3)

wln := 7.50

IF !EMPTY(wfilme1)

oPrn:CmSay( wln+(winc* 1.0), 1.0, wfilme1, oFont3)

oPrn:CmSay( wln+(winc* 1.0), 13.5, TRANSFORM(wqdade1, "@E 999,999"), oFont3,,,2,1)

oPrn:CmSay( wln+(winc* 1.0), 16.5, TRANSFORM(wvalor1, "@E 999,999.99"), oFont3,,,2,1)

oPrn:CmSay( wln+(winc* 1.0), 20.0, TRANSFORM((wqdade1*wvalor1), "@E 999,999.99"), oFont3,,,2,1)

ENDIF

oPrn:CmSay( 23.40, 20.0, TRANSFORM(wTotal, "@E 999,999.99"), oFont3,,,2,1)

oPrn:EndPage()

SysWait(.5)

oFont8:end()

oFont:end()

oFont1:end()

oFont2:end()

oFont3:end()

ENDPRINTER

oPdf := NIL

RELEASE oPdf

RETURN(NIL)

Editado por - hinfo on 23/07/2012 18:49:42

Editado por - hinfo on 24/07/2012 09:42:56

Link to comment
Share on other sites

O erro deve está na variável WDOCUMENTO, verifique o valor

dela antes da concatenação, exemplo

? wdocumento

cpdf_file := wFilePdf + STRZERO(wdocumento,6,0) + ".PDF"

// initialize Bullzip PDF settings

************************************************************

oPdf := TOleAuto():New( "Bullzip.PDFPrinterSettings" )

Rikko

Guaratinguetá - SP

(12) 8829-8088

E-Mail: mkyx@ig.com.br

pardes.mky@hotmail.com

MSN:pardes.mky@hotmail.com

www.adentech.com.br

www.rmahost.com

xH 1.1.0 Hb 8.02 - BCC 55

Link to comment
Share on other sites

Bom dia Rikko

O conteudo do wdocumento esta correto, tanto que ele gera o relatorio com o numero correto, mas ele coloca o nome do arquivo com o documento seguinte.

Eh como ele gerasse o nome do arquivo somente depois de ler o registro seguinte.

Em que momento eh gerado o arquivo?

Grato pela atencao

Helio Tsuyama

Santo Andre - SP

fw12.01-xhb1.2.1-xDev0.7 - bcc 5.82

hbinfo.br@gmail.com

Link to comment
Share on other sites

Erro de logica, o Rikko estava certo.

cpdf_file := wFilePdf + STRZERO(cessao->documento,6,0) + ".PDF"

DO WHILE .NOT.EOF()

wtotal := 0.00

wdocumento := cessao->documento

wdata := DTOC(data)

wrazao := razao

wtotal := wtotal +( qdade10*valor10 )

Relat43()

cpdf_file := wFilePdf + STRZERO(cessao->documento,6,0) + ".PDF"

SKIP

ENDDO

Relat43()

CLOSE Cessao

Muito Obrigado a todos.

O Bullzip eh muito facil de usar.

Helio Tsuyama

Santo Andre - SP

fw12.01-xhb1.2.1-xDev0.7 - bcc 5.82

hbinfo.br@gmail.com

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...