// Using CorelDraw to generate printing templates!!!
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
function Main()
LOCAL oPrn, oFont, oIni, oPrinter
Local cDescri:= "article description line here test"
Local nprice := 12.00
Local nTax := 20
Local nRowFirst := 11
Local nTotal:= 0
Local nTotalRow:=0
PRINTER oPrn PREVIEW
DEFINE FONT oFont NAME "Times New Roman" SIZE 0,-12 OF oPrn
PAGE
oPrn:ImportWMF( "fattura.emf" )
oItem_nTop=240.23
oItem_nLeft=161.87
oItem_nHeight=5.62
oItem_nWidth=32.71
say_myRpt(oPrn, oItem_nTop,oItem_nLeft,oItem_nHeight,oItem_nWidth,Transform(nTotal, "999,999.99"),ofont,1)
oItem_nTop=66.41
oItem_nLeft=129.39
oItem_nHeight=5.86
oItem_nWidth=17.09
say_myRpt(oPrn, oItem_nTop,oItem_nLeft,oItem_nHeight,oItem_nWidth,"09876",ofont,1)
oItem_nTop=66.41
oItem_nLeft=147.71
oItem_nHeight=5.86
oItem_nWidth=22.22
say_myRpt(oPrn, oItem_nTop,oItem_nLeft,oItem_nHeight,oItem_nWidth,dtoc(date()),ofont,1)
oItem_nTop=271.48
oItem_nLeft=138.67
oItem_nHeight=3.91
oItem_nWidth=50.05
say_myRpt(oPrn, oItem_nTop,oItem_nLeft,oItem_nHeight,oItem_nWidth,dtoc(date())+time(),ofont,1)
ENDPAGE
ENDPRINT
oFont:End()
return nil
//----------------------------------------------------------------------------//
Function say_myRpt(oPrn, oItem_nTop,oItem_nLeft,oItem_nHeight,oItem_nWidth,ctext,ofont,nPad)
Local nTop,nLeft
Local nWidth := oItem_nWidth
oPrn:Mmtr2Pix( 0, @nWidth )
nWidth += oPrn:nYOffset
nTop := Max( 0, ( oItem_nTop * oPrn:nVertRes() / oPrn:nVertSize() ) )
nLeft := Max( 0, ( oItem_nLeft * oPrn:nHorzRes() / oPrn:nHorzSize() ) )
oPrn:Say(nTop,nLeft,cText , oFont, nWidth, , , npad )
return nil