Dear All ,
How to either Print or Generate PDF File to particular folder location without EasyReport Dialog Box. What is COMMAND for that ? Please guide me.
Thanks
Shridhar
Shridhar
FWH 24.04, BCC 7 32 bit, MariaDB
Dear All ,
How to either Print or Generate PDF File to particular folder location without EasyReport Dialog Box. What is COMMAND for that ? Please guide me.
Thanks
Shridhar

Dear Otto ,
In my old (Clipper) application I do print Invoice directly to the printer without any preview.
So EASYREPORT command should be below :
1) Directly to the Default OR Given Name printer
EASYREPORT oVRD NAME "Inv.vrd" TO PRINTER DEFAULT | HP-PRINTER1
PRINTAREA 1 ...
oVRD:End()
2) Directly to the FILE either one of the type PDF , WORD, TEXT
EASYREPORT oVRD NAME "Inv.vrd" TO FILE "C:\APP\OUTPUT\invoice.pdf" TYPE PDF | WORD | TEXT
PRINTAREA 1 ...
oVRD:End()
Thanks
Shridhar
Dear Shridhar,
yes you can du that. What is not working - as fare as I know - is PDF. But you can print to a PDF printer.
I send you how to set up EASYREPORT.
Best regards
Otto
cDruckerName := "HP-PRINTER1"
lPreview := .F.
EASYREPORT oVRD NAME ".\xVrd\RGA5.vrd" PREVIEW lPreview TO cDruckerName PRINTDIALOG IIF( lPreview, .F., .F. ) //Standarddrucker umstellen vor man das EASYREPORT object erstellt
coldprinter := StandardDruckerUmstellen( cDruckerName )
EASYREPORT ::oVRD NAME ".\xVrdSchmal\rg.vrd" PREVIEW lPreview TO cDruckerName PRINTDIALOG IIF( lPreview, .F., .F. )
//nach dem Zerstören des Easyreport objects wieder zurücksetzen
::oVRD:End()
change2default_printer( coldprinter )
local coldprinter := ""
local cDruckerName := ""
*----------------------------------------------------------
//GetDefaultPrinter() statt Fineprint
cDruckerName := GetPvProfString( "DRUCKER", "Standard" ,"FinePrint", ".\INI\WINHOTEL.INI" )
coldprinter := StandardDruckerUmstellen( cDruckerName )
change2default_printer( coldprinter )
//coldprinter := StandardDruckerUmstellen( cDruckerName )
function StandardDruckerUmstellen( cDruckerName )
local coldprinter := prnGetName() // default printer
*----------------------------------------------------------
if len( ALLTRIM( cDruckerName ) ) > 0
WriteProfString( "windows", "device", cDruckerName ) // change to new printer
SetPrintDefault( cDruckerName )
PrinterInit()
SysRefresh()
endif
return( coldprinter )
//------------------------------------------------------------------------------------------//
function change2default_printer( coldprinter )
WriteProfString( "windows", "device",coldprinter) // default printer
SetPrintDefault(coldprinter)
PrinterInit()
SysRefresh()
return nil
//------------------------------------------------------------------------------------------//Dear Otto ,
Thanks for this information... ! I will check with the Printer as I have HP Printer and will update on this.
But Also we need to print option to the directly PDF File with File Name.
Thanks
Shridhar
EASYREPORT <oRep> NAME <cRepFileName> [PREVIEW .t.] FILE <cPdfFileName>Dear Sir ,
Many Thanks for this new feature.
Thanks
Shridhar
Mr Nages
good afternoon
First of all I want to thank you for all the contributions you make to the community.
On the other hand I wanted to know if the functionality to send directly to pdf without going through the preview is already available with fwh1905.
On the other hand, I need to place a QR barcode. I have seen that with the PRINT class it is already working. But I wanted to know if I can do it with EASY REPORT.
Beforehand thank you very much.
Translation by google
Mr Nages.
buenas tardes
Primero que todo quiero darle gracias por todos los aportes que realiza a la comunidad.
Por otro lado queria saber si la funcionalidad para enviar directamente a pdf sin pasar por la previsualizacion ya está disponible con fwh1905.
Por otro lado, requiero colocar un código de barras QR. he visto que con la clase PRINT ya está trabajando. Pero quería saber si lo puedo hacer con EASY REPORT.
De antemano muchas gracias.
On the other hand I wanted to know if the functionality to send directly to pdf without going through the preview is already available with fwh1905.
On the other hand, I need to place a QR barcode. I have seen that with the PRINT class it is already working. But I wanted to know if I can do it with EASY REPORT.
Mr. Nages
Thank you very much, I will do the tests and comment.
*****************************************
*IMPRESION DE REPORTE
*****************************************
PROC pFactura()
local oReport,Pagina:=nLinea := 1
local vTCRCua:=0,vTCRVal:=0
local vTCan:=vTHoj:=vTSub:=vTota:=0
uFec:=dtoc(date())
uTim:=subs(time(),1,8)
EASYREPORT oVRD NAME "C:\HYMINVEN\HYMMA\REP\FACTURAC.vrd" PREVIEW (.T.) //OF oDlg2
IF oVRD:lDialogCancel = .T.
RETURN( .F. )
ENDIF
PRINTAREA 1 OF oVRD
PRINTAREA 2 OF oVRD
PRINTAREA 6 OF oVRD;
ITEMIDS {601};
ITEMVALUES { "Value Code"}
END EASYREPORT oVRD
return nil PRINTAREA 6 OF oVRD;
ITEMIDS {601};
ITEMVALUES { oVRD:SayBarCode( "Value Code", { 20,20,-20,-20 })} Message not found: VRD:SAYBARCODE***************
*CREA CODIGO QR
***************
function BarCode(valor)
local nX := 18
local nY := 18
local hFont
local cCode := valor
DEFINE FONT oFontText NAME "Calibri" SIZE 0, -11
if Empty( hBrush )
hBrush := CreateSolidBrush( 0 )
hZebra := hb_Zebra_Create_Qrcode( cCode, NIL )
hb_zebra_draw( hZebra, { | x, y, w, h | nWidth := x + w, nHeight := y + h, ;
FillRect( dwpri:hDC, { y, x, y + h, x + w }, hBrush ) }, nX, nY, 11, 11 )
oFontText:Activate( dwpri:hDC )
DrawText( dwpri:hDC, cCode, { nHeight + 10 , nX - 4, nHeight + 24, nWidth + 4 }, 0 )
oFontText:DeActivate( dwpri:hDC )
endif
return nil
******************
*LO GRABA EN DISCO
******************
Function SaveCode(vNomQR)
local ruta := Pub:DIRLOCAL+Pub:CODEMP+"\REP\"
local oBmp
local hGraf
local hBmp
local hBrush1 := GdiPlusNewSolidBrush( 255, 255, 255, 255 )
local hBrush2 := GdiPlusNewSolidBrush( 255, 0, 0, 0 )
local nombreCodigo := Retorna_Caracter(vNomQR)
oBmp := GdiBmp():New()
hBmp := GdiPlusBmpFromBrush( nWidth + 18, nHeight + 18, hBrush1 )
hGraf := GdiPlusHGraFFromHBmp( hBmp )
hb_zebra_draw( hZebra, { | x, y, w, h | GdiPlusDrawRect( hGraf, , hBrush2, x, y, w, h ) }, 18, 18, 11, 11 )
oBmp:hBmp := hBmp
GdiPlusDeleteGraphics( hGraf )
GdiPlusDeleteBrush( hBrush2 )
GdiPlusDeleteBrush( hBrush1 )
oBmp:Save( ruta+nombreCodigo+".png" )
oBmp:End()
Return nil
//----------------------------------------------------------------------------//EASYREPORT oVRD NAME Pub:DIRLOCAL+Pub:CODEMP+"\REP\factura.vrd" PREVIEW .T. FILE rutaPDF
....
...
END EASYREPORT oVRDThe problem that I find now is that it only works well when I enter the system and perform the first preview, send the complete pdf file to the hard disk. But at the moment of generating the second preview whatever it may be, what it generates is a blank page.
I do not know if this is a bug of fw, because it also happens in the preview of the tprint class.
Good afternoon for all, looking in the forum I found some functions that our friend Cristobal Navararro published, to generate the QR codes to the hard disk. Then as images I add them to the report in ER.
FW_SaveImage( FW_BarCodeBmp( cText, "QR", nWidth, nHeight ), cBmpFile )