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
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
//------------------------------------------------------------------------------------------//
EASYREPORT <oRep> NAME <cRepFileName> [PREVIEW .t.] FILE <cPdfFileName>
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.
*****************************************
*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 oVRD
The 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 )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 38 guests