How to preview a report using tprinter and at the same time have a copy of it silently saved as a pdf in the background?
My experiment so far tends to have the exe just silently terminates. I was using FWH15.01 and FWSavePreviewToPdf()
TIA
Preview and save to pdf at the same time
Preview and save to pdf at the same time
FWH 11.08/FWH 19.03
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
Re: Preview and save to pdf at the same time
I made this changes in rpreview.prg, in:
METHOD PrintPage() CLASS TPreview
....
if ! lCancel
MsgRun( ::oDevice:cDocument, "Imprimiendo Reporte",;
{ || ::PrintPrv( nil, nOption, nFirst, nLast ) } )
// daniel 2016-07-29
* ? 'ACA GUARDAR PDF',oApp:lGuardarPDF,oApp:cImprimiendo
IF oApp:lGuardarPDF
IF oApp:cImprimiendo == 'RECIBO'
cRutaPDF:=oApp:cRutaPDFRecibos
ELSEIF oApp:cImprimiendo == 'FE'
cRutaPDF:=oApp:cRutaPDFFE
ELSEIF oApp:cImprimiendo == 'PRESUPUESTO'
cRutaPDF:=oApp:cRutaPDFPresupuestos
ENDIF
MsgRun( ::oDevice:cDocument, "Guardando PDF",;
{ || ::SaveAs( .t.,cRutaPdf+'\'+::oDevice:cDocument,.F. ) } )
ENDIF
endif
METHOD PrintPage() CLASS TPreview
....
if ! lCancel
MsgRun( ::oDevice:cDocument, "Imprimiendo Reporte",;
{ || ::PrintPrv( nil, nOption, nFirst, nLast ) } )
// daniel 2016-07-29
* ? 'ACA GUARDAR PDF',oApp:lGuardarPDF,oApp:cImprimiendo
IF oApp:lGuardarPDF
IF oApp:cImprimiendo == 'RECIBO'
cRutaPDF:=oApp:cRutaPDFRecibos
ELSEIF oApp:cImprimiendo == 'FE'
cRutaPDF:=oApp:cRutaPDFFE
ELSEIF oApp:cImprimiendo == 'PRESUPUESTO'
cRutaPDF:=oApp:cRutaPDFPresupuestos
ENDIF
MsgRun( ::oDevice:cDocument, "Guardando PDF",;
{ || ::SaveAs( .t.,cRutaPdf+'\'+::oDevice:cDocument,.F. ) } )
ENDIF
endif