Unattended creation of .pdf . resolution problem -- RESOLVED

Unattended creation of .pdf . resolution problem -- RESOLVED

Postby Rick Lipkin » Thu Sep 16, 2021 1:17 pm

Rao

The attached code ( Reqprint1.txt ) has my logic for creating an un-attended .pdf that creates a Travel Request ... I pass the value of 3 to ReqPrint1 .... Func _ReqPrint1( nView,oDlg,oSay,cSay,oRsTrav ) .. see attached .Txt .. The values of the code are irrelevant .. Attached file TSHIREY2.pdf is the CORRECT resolution ( notice the difference in the file sizes ) and is the result I am looking for .. on certain machines .. TSHIREY.1.pdf for some reason is generated with the wrong resolution.

Question ... How is oPrinter object created in this code .. nView = 3

//nView := 3

Do Case
Case nVIEW = 1
PRINTER oPRINT FROM USER ;
PREVIEW MODAL ;
NAME "Request Print Routine "+xLOGIN

IF EMPTY( oPRINT:hDC )
MsgStop ( "Printer not Ready !" )
CLOSE DATABASES
oDlg:END()
RETURN(NIL)
ENDIF

Case nVIEW = 2

PRINTER oPRINT from USER ;
NAME "Request Print Routine for "+xLOGIN

IF EMPTY( oPRINT:hDC )
MsgStop ( "Printer not Ready !" )
CLOSE DATABASES
oDlg:END()
RETURN(NIL)
ENDIF

Case nVIEW = 3

PRINT oPrint FILE "c:\dbtmp\"+cPdfName+".pdf" //<------- here

EndCase
....
....

Since there is no direct pointer to a Printer .. where is oPrinter getting its values ... In the attached program .. I evaluate oPrinter to get the Horizontal and vertical values :

nRowStep := oPrint:nVertRes() / 55 // pixel per line = 57.65 @ 55
nColStep := oPrint:nHorzRes() /130 // columns

I use these values to place the output in specific places within the above range .. and use font pixels to arrange the text in the way I want the lines to print .. I realize the attached code may be a bit complex without the data .. but please review the .pdf attachments ...

TSHIREY2.pdf is the CORRECT resolution and is the result I am looking for .. on certain machines ( however ) .. TSHIREY.1.pdf for some reason is generated with the wrong resolution... same code different computers ..

Let me know what you think .. this appears to be a .pdf resolution problem and I think the value of oPrint is the culprit. I am using FWH 2006.

Thanks
Rick Lipkin

Code: Select all  Expand view  RUN

// ReqPrint1.prg

#INCLUDE "FIVEWIN.CH"


Static lOk

//-------------------------------------------
//  Global Function to be used when request is Approved or Rejected
//
Func _ReqPrint1( nView,oDlg,oSay,cSay,oRsTrav )     // cToPrf

Local oPrint
Local oFont8,oFont8b,oFont10,oFont10b,ofont12ib,oFont12b,oFOnt14,oFont24b,oFont10d,oFont10i
Local oPen1,nLines,nPages,nMargin,nPage
Local nRowStep,nColStep
Local cHead1,cHead2,cText,yText,nPrice
Local xLine,nLinCnt,i
Local dDate

Local  cTrainTp1,cTrainTp2,cTrainTp3,cTrainTp4,cTrainTp5,cTrainTp6
Local cLogin,cEmail,nStart
Local dLeave,dReturn
Local cPdfName,cReplace

cEmail := oRsTrav:Fields("EmpEmail"):Value

if empty(cEmail)
   cEmail := alltrim(xLogin)
Else
   nStart := at( "@", cEmail )
   cEmail := Substr(cEmail,1,nStart-1)
Endif

cPdfName := cEmail



dLeave  :=If(empty(oRsTrav:Fields("Leave"):Value),ctod("00/00/00"),;
                    TtoDate(oRsTrav:Fields("Leave"):Value))
dReturn :=If(empty(oRsTrav:Fields("Return"):Value),ctod("00/00/00"),;
                    TtoDate(oRsTrav:Fields("Return"):Value))

cPdfName := cPdfName+"_"+dtoc(dLeave)+"_To_"+dtoc(dReturn)
cReplace := strtran(cPdfName,"/","-" )

cPdfName := cReplace

*msginfo( "cPdfName in Request "+cPdfName )

//nView := 3

Do Case
Case nVIEW = 1
   PRINTER oPRINT FROM USER                ;
   PREVIEW MODAL                           ;
   NAME "Request Print Routine "+xLOGIN

   IF EMPTY( oPRINT:hDC )
      MsgStop ( "Printer not Ready !" )
      CLOSE DATABASES
      oDlg:END()
      RETURN(NIL)
   ENDIF

Case nVIEW = 2

   PRINTER oPRINT from USER                ;
   NAME "Request Print Routine for "+xLOGIN

   IF EMPTY( oPRINT:hDC )
      MsgStop ( "Printer not Ready !" )
      CLOSE DATABASES
      oDlg:END()
      RETURN(NIL)
   ENDIF

Case nVIEW = 3

    PRINT oPrint FILE "c:\dbtmp\"+cPdfName+".pdf"
EndCase

oFont8    := TFont():New( "
Times New Roman", 0,-8, .F.,.F. , , , ,.F.,,,,,,, oPRINT, )
oFont8b   := TFont():New( "
Times New Roman", 0,-8, .F.,.T. , , , ,.F.,,,,,,, oPRINT, )
oFont10   := TFont():New( "
Arial",           0,-9, .F.,.F. , , , ,.F.,,,,,,, oPRINT, ) //-10
oFont10b  := TFont():New( "
Times New Roman", 0,-10,.F.,.T. , , , ,.F.,,,,,,, oPRINT, )
oFont10i  := TFont():New( "
Times New Roman", 0,-10,.F.,.T. , , , ,.T.,,,,,,, oPRINT, )
oFont12ib := TFont():New( "
Times New Roman", 0,-12,.F.,.T. , , , ,.T.,,,,,,, oPRINT, )
oFont12b  := TFont():New( "
Times New Roman", 0,-12,.F.,.T. , , , ,.F.,,,,,,, oPRINT, )
oFont14b  := TFont():New( "
Times New Roman", 0,-14,.F.,.T. , , , ,.F.,,,,,,, oPRINT, )
oFont24b  := TFont():New( "
Times New Roman", 0,-24,.F.,.T. , , , ,.F.,,,,,,, oPRINT, )

oFont10d  := TFont():New(  "
Courier New",    0,-10,.F.,.T. , , , ,.F.,,,,,,, oPRINT, )

DEFINE PEN oPen1 WIDTH 1 // 5 //10

*cSay := "
Generating Output"
*oSay:ReFresh()
*SysReFresh()

*SysWait(1)  // take out later

//lIsRunning := .t.    // cancel trap


nLines    := 0
nPages    := 1

nRowStep := oPrint:nVertRes() / 55      // pixel per line = 57.65 @ 55
nColStep := oPrint:nHorzRes() /130      // columns

oPRINT:StartPage()

nMargin := Int(oPrint:nLogPixelX()*0.2)
LINE    := nMargin
nPage   := 1

cHead1 := "
State of South Carolina Department of Insurance"
cHead2 := "
Travel / Training Request Form"

oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.25), cHead1, oFONT14b )
Line += oFont12b:nHeight
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.34), cHead2, oFONT14b )
Line += oFont12b:nHeight
Line += oFont12b:nHeight

oPrint:Line( line, (oPrint:nHorzRes()*.02 ), line, (oPrint:nHorzRes()*.9792), oPen1 )   // top line

Line += oFont12b:nHeight
cText := "
Is this Associated with a"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10 )
cText := If(empty(oRsTrav:Fields("
PrevAppr"):Value)," ",oRsTrav:Fields("PrevAppr"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.21), cText, oFONT10b )

Line += oFont10b:nHeight
cText := "
Previously approved"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10 )
Line += oFont10b:nHeight
cText := "
Designation (Y/N)"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10 )

*oPrint:Box( line, (oPrint:nHorzRes()* .20 ), Line* .77, (oPrint:nHorzRes()*.23 ),  oPen1 )   // associaed with

Line -= oFont14b:nHeight+5
Line -= oFont8b:nHeight-12

cText := "
If Yes, Please list"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.25), cText, oFONT10 )
Line += oFont10b:nHeight
cText := "
Designation"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.25), cText, oFONT10 )
Line += oFont10b:nHeight
cText := "
( 200 char )"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.25), cText, oFONT10 )

Line -= oFont14b:nHeight+22
oPrint:Box( line, (oPrint:nHorzRes()* .38 ), Line* 1.70, (oPrint:nHorzRes()*.81 ),  oPen1 )    // designation box

xLine := Line
cText := oRsTrav:Fields("
Design"):Value

If Empty(cText) .or. cText = "
 "
Else

   Line += oFont8:nHeight-10

   cText := Alltrim( cText)
   nLinCnt := MlCount( cText, 75 )

   IF nLinCnt > 0
      For x := 1 to nLinCnt
          yText := MemoLine( cText, 75, x )
          oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.39 ), yText, oFONT8 )
          Line += oFont8:nHeight
      Next
   Endif

Endif

Line := xLine

cText := "
In State    (Y/N)"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.82), cText, oFONT10 )
cText := If(empty(oRsTrav:Fields("
InState"):Value)," ",oRsTrav:Fields("Instate"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.96), cText, oFONT10b )

Line += oFont12b:nHeight+20

Line -= oFont14b:nHeight+4
Line += oFont14b:nHeight//+20
Line += oFont10b:nHeight

cText := "
Out State (Y/N)"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.82), cText, oFONT10 )
cText := If(empty(oRsTrav:Fields("
OutState"):Value)," ",oRsTrav:Fields("OutState"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.96), cText, oFONT10b )
Line += oFont12b:nHeight+20

*oPrint:Box( line, (oPrint:nHorzRes()* .98 ), Line* .81, (oPrint:nHorzRes()*.95 ),  oPen1 )     // out state

*Line -= oFont14b:nHeight+8
*Line += oFont12b:nHeight+40        // fixed overlap

Line += oFont12b:nHeight+20
Line += oFont12b:nHeight+3

cText := "
Date Leaving or Starting   :"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10 )
dDate := If(empty(oRsTrav:Fields("
Leave"):Value),ctod("00/00/00"),;
                    TtoDate(oRsTrav:Fields("
Leave"):Value))
cText := dtoc(dDate)
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.25), cText, oFONT10b )

cText := "
Vendor / Sponsor    :"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.38), cText, oFONT10 )
cText := If(empty(oRsTrav:Fields("
Sponsor"):Value)," ",oRsTrav:Fields("Sponsor"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.55), cText, oFONT10b )

Line += oFont10b:nHeight
cText := "
Date Returning or Ending :"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10 )
dDate := If(empty(oRsTrav:Fields("
Return"):Value),ctod("00/00/00"),;
                    TtoDate(oRsTrav:Fields("
Return"):Value))
cText := dtoc(dDate)
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.25), cText, oFONT10b )

cText := "
Conference / Event :"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.38), cText, oFONT10 )
cText := If(empty(oRsTrav:Fields("
Event"):Value)," ",oRsTrav:Fields("Event"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.55), cText, oFONT10b )

// employee name
Line += oFont10b:nHeight
cText := "
Emp Name   :"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10 )
cText := If(empty(oRsTrav:Fields("
Employee"):Value)," ",oRsTrav:Fields("EMployee"):Value )
cText := UpperLower( cText )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.13), cText, oFONT10b )

cText := "
Location                   :"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.38), cText, oFONT10 )
cText := If(empty(oRsTrav:Fields("
Location"):Value)," ",oRsTrav:Fields("Location"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.55), cText, oFONT10b )

Line += oFont10b:nHeight
cText := "
Emp E-Mail   :"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10 )
cText := If(empty(oRsTrav:Fields("
EmpEmail"):Value)," ",oRsTrav:Fields("EmpEmail"):Value )
cText := Lower( cText )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.13), cText, oFONT10b )

Line += oFont8:nHeight
cText := "
Meals"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.55), cText, oFONT10 )
cText := "
Cost"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.783), cText, oFONT10 )
cText := "
Total"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.94), cText, oFONT10 )

Line -= oFont8:nHeight
Line += oFont10b:nHeight
Line += oFont10b:nHeight

cText := "
Purpose or"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10 )

// number of breakfasts --------------------------

nPrice := If(empty(oRsTrav:Fields("
Break"):Value), 0, oRsTrav:Fields("Break"):Value )

Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.565  ), Transform( nPrice, "
9,999" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.565 ), Transform( nPrice, "
9,999" ), oFont10b )
Case nPrice >= 10 .and. nPrice < 100

   oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.56  ), Transform( nPrice, "
9,999" ), oFont10b )

Case nPrice >= 100 .and. nPrice < 1000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.556 ), Transform( nPrice, "
9,999" ), oFont10b )
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.55  ), Transform( nPrice, "
9,999" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.54  ), Transform( nPrice, "
99,999" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.54  ), Transform( nPrice, "
99,999" ), oFont10b )
EndCase

oPrint:Line( line, (oPrint:nHorzRes()*.55 ), line, (oPrint:nHorzRes()*.9792), oPen1 )   // top line

// BREAKFAST -----------------------------------------------

cText := "
Breakfasts  x"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.62 ), cText, oFONT10 )
nPrice := If(empty(oRsTrav:Fields("
BreakC"):Value), 0.00, oRsTrav:Fields("BreakC"):Value )

// breakfast cost

Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.77  ), Transform( nPrice, "
9,999.99" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.77 ), Transform( nPrice, "
9,999.99" ), oFont10b )  /////
Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.77  ), Transform( nPrice, "
9,999.99" ), oFont10b )
Case nPrice >= 100 .and. nPrice < 1000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.62 ), Transform( nPrice, "
9,999.99" ), oFont10b )
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.62  ), Transform( nPrice, "
9,999.99" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.60  ), Transform( nPrice, "
99,999.99" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.60  ), Transform( nPrice, "
99,999.99" ), oFont10b )
EndCase

cText := "
= $"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.85 ), cText, oFONT10 )

// breakfast totals

nPrice := If(empty(oRsTrav:Fields("
BreakT"):Value), 0.00, oRsTrav:Fields("BreakT"):Value )

Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.9238 ),Transform( nPrice, "
999,999.99" ), oFONT10b  )    //.92
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.9238 ),Transform( nPrice, "
999,999.99" ), oFont10b )
                                       // 92
 Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.92 ),Transform( nPrice, "
999,999.99" ), oFont10b )     /////////
Case nPrice >= 100 .and. nPrice < 1000
   oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.915), Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.91), Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.91), Transform( nPrice, "
999,999.99" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), Transform( nPrice, "
999,999.99" ), oFont10b )
EndCase

oPrint:Box( line, (oPrint:nHorzRes()* .11 ), Line* 1.28, (oPrint:nHorzRes()*.54 ),  oPen1 )    // purpose or benefits box

Line += oFont10b:nHeight
cText := "
Benefits"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10 )

// LUNCH --------------------------------------------------
// number of lunches

nPrice := If(empty(oRsTrav:Fields("
Lunch"):Value), 0, oRsTrav:Fields("Lunch"):Value )

Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.565  ), Transform( nPrice, "
9,999" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.565 ), Transform( nPrice, "
9,999" ), oFont10b )
Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.56  ), Transform( nPrice, "
9,999" ), oFont10b )
Case nPrice >= 100 .and. nPrice < 1000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.556 ), Transform( nPrice, "
9,999" ), oFont10b )
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.55  ), Transform( nPrice, "
9,999" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.54  ), Transform( nPrice, "
99,999" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.54  ), Transform( nPrice, "
99,999" ), oFont10b )
EndCase

// lunch cost

cText := "
Lunches     x"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.62 ), cText, oFONT10 )

nPrice := If(empty(oRsTrav:Fields("
LunchC"):Value), 0.00, oRsTrav:Fields("LunchC"):Value )

Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.77  ), Transform( nPrice, "
9,999.99" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.62 ), Transform( nPrice, "
9,999.99" ), oFont10b )

Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.765 ), Transform( nPrice, "
9,999.99" ), oFont10b )

Case nPrice >= 100 .and. nPrice < 1000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.62 ), Transform( nPrice, "
9,999.99" ), oFont10b )
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.62  ), Transform( nPrice, "
9,999.99" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.60  ), Transform( nPrice, "
99,999.99" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.60  ), Transform( nPrice, "
99,999.99" ), oFont10b )
EndCase


cText := "
= $"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.85 ), cText, oFONT10 )

// lunch totals

nPrice := If(empty(oRsTrav:Fields("
LunchT"):Value), 0.00, oRsTrav:Fields("LunchT"):Value )

Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.9238 ),Transform( nPrice, "
999,999.99" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.92 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.92 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 100 .and. nPrice < 1000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.915),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.91), Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), Transform( nPrice, "
999,999.99" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), Transform( nPrice, "
999,999.99" ), oFont10b )
EndCase


Line += oFont10b:nHeight
cText := "
(200) char"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10 )

// number of dinner meals

nPrice := If(empty(oRsTrav:Fields("
Dinner"):Value), 0, oRsTrav:Fields("Dinner"):Value )

Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.565  ), Transform( nPrice, "
9,999" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.565 ), Transform( nPrice, "
9,999" ), oFont10b )
Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.56  ), Transform( nPrice, "
9,999" ), oFont10b )
Case nPrice >= 100 .and. nPrice < 1000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.556 ), Transform( nPrice, "
9,999" ), oFont10b )
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.55  ), Transform( nPrice, "
9,999" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.54  ), Transform( nPrice, "
99,999" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.54  ), Transform( nPrice, "
99,999" ), oFont10b )
EndCase


// dinner cost

cText := "
Dinners       x"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.62 ), cText, oFONT10 )
nPrice := If(empty(oRsTrav:Fields("
DinnerC"):Value), 0.00, oRsTrav:Fields("DinnerC"):Value )


Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.77  ), Transform( nPrice, "
9,999.99" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.62 ), Transform( nPrice, "
9,999.99" ), oFont10b )

Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.765), Transform( nPrice, "
9,999.99" ), oFont10b )

Case nPrice >= 100 .and. nPrice < 1000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.62 ), Transform( nPrice, "
9,999.99" ), oFont10b )
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.62  ), Transform( nPrice, "
9,999.99" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.60  ), Transform( nPrice, "
99,999.99" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.60  ), Transform( nPrice, "
99,999.99" ), oFont10b )
EndCase


cText := "
= $"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.85 ), cText, oFONT10 )


// dinner totals

nPrice := If(empty(oRsTrav:Fields("
DinnerT"):Value), 0.00, oRsTrav:Fields("DinnerT"):Value )

Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.9238 ),Transform( nPrice, "
999,999.99" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.92 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.92 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 100 .and. nPrice < 1000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.915), Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.91), Transform( nPrice, "
999,999.99" ), oFont10b )     /////////////////
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), Transform( nPrice, "
999,999.99" ), oFont10b )
  OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), Transform( nPrice, "
999,999.99" ), oFont10b )
EndCase

Line += oFont10b:nHeight
Line += oFont10b:nHeight

oPrint:Line( line, (oPrint:nHorzRes()*.55 ), line, (oPrint:nHorzRes()*.9792), oPen1 )   // bottom line  ------------------------------
cText := "
Total for Meals"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.79), cText, oFONT10 )

nPrice := If(empty(oRsTrav:Fields("
TMeals"):Value), 0.00, oRsTrav:Fields("TMeals"):Value )
Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.9238 ),Transform( nPrice, "
999,999.99" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.92 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.92 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 100 .and. nPrice < 1000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.915 ), Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.91), Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), Transform( nPrice, "
999,999.99" ), oFont10b )
  OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), Transform( nPrice, "
999,999.99" ), oFont10b )
EndCase

// recalc for Benefits comments
xLine := line
cText := oRsTrav:Fields("
Benefits"):Value

If Empty(cText) .or. cText = "
 "
Else

   Line += oFont14b:nHeight-200

   cText := Alltrim( cText)
   nLinCnt := MlCount( cText, 75 )

   IF nLinCnt > 0
      For x := 1 to nLinCnt
          yText := MemoLine( cText, 75, x )
          oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.12 ), yText, oFONT8 )
          Line += oFont8:nHeight
      Next
   Endif

Endif

Line := xLine

Line += oFont10b:nHeight
Line += oFont10b:nHeight

cText := "
Cont Ed Credits going to be Obtained (Y/N)?"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10 )
cText := If(empty(oRsTrav:Fields("
ContEdCr"):Value), "N", oRsTrav:Fields("ContEdCr"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.37), cText, oFONT10b )
Line += oFont10b:nHeight
cText := "
If YES, How Many ?"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10 )
cText := If(empty(oRsTrav:Fields("
HowMany"):Value), 0, oRsTrav:Fields("HowMany"):Value )
cText := Transform( cText,"
999" )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.364), cText, oFONT10b )
Line += oFont10b:nHeight
cText := "
Are you making a Speach or Presentation (Y/N) ?"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10 )
cText := If(empty(oRsTrav:Fields("
Speach"):Value), "N", oRsTrav:Fields("Speach"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.37), cText, oFONT10b )
Line += oFont10b:nHeight

cText := "
Hotel"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.55), cText, oFONT10 )
nPrice := If(empty(oRsTrav:Fields("
Nights"):Value), 0, oRsTrav:Fields("Nights"):Value )

Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.64  ), Transform( nPrice, "
9,999" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.64 ),  Transform( nPrice, "
9,999" ), oFont10b )
Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.64 ),  Transform( nPrice, "
9,999" ), oFont10b )
Case nPrice >= 100 .and. nPrice < 1000
    oPRINT:SAY ( LINE, (oPrint:nHorzRes()* .63  ), Transform( nPrice, "
9,999" ), oFont10b )  //////
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.625 ),  Transform( nPrice, "
9,999" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.625  ), Transform( nPrice, "
99,999" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.625  ), Transform( nPrice, "
99,999" ), oFont10b )
EndCase

cText := "
Nights @"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.68), cText, oFONT10 )

nPrice := If(empty(oRsTrav:Fields("
HCost"):Value), 0.00, oRsTrav:Fields("HCost"):Value )

// hotel cost

Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.77  ), Transform( nPrice, "
9,999.99" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.77 ), Transform( nPrice, "
9,999.99" ), oFont10b )  /////
Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.765  ), Transform( nPrice, "
9,999.99" ), oFont10b )
Case nPrice >= 100 .and. nPrice < 1000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.765), Transform( nPrice, "
9,999.99" ), oFont10b )
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.62  ), Transform( nPrice, "
9,999.99" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.60  ), Transform( nPrice, "
99,999.99" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.60  ), Transform( nPrice, "
99,999.99" ), oFont10b )
EndCase


// hotel total dollars
cText := "
= $"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.85 ), cText, oFONT10 )

nPrice := If(empty(oRsTrav:Fields("
THotel"):Value), 0.00, oRsTrav:Fields("THotel"):Value )
Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.9238 ),Transform( nPrice, "
999,999.99" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.92 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.917 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 100 .and. nPrice < 1000
   oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.915), Transform( nPrice, "
999,999.99" ), oFont10b )

Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.91), Transform( nPrice, "
999,999.99" ), oFont10b )

  Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), Transform( nPrice, "
999,999.99" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), Transform( nPrice, "
999,999.99" ), oFont10b )
EndCase

Line += oFont10b:nHeight

cText := "
Type of Training (Y/N)?"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10 )
cText := "
Mileage"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.55), cText, oFONT10 )

// number of miles driven

nPrice := If(empty(oRsTrav:Fields("
NumMiles"):Value), 0.000, oRsTrav:Fields("NumMiles"):Value )
Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.635  ), Transform( nPrice, "
99,999" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.635 ),  Transform( nPrice, "
99,999" ), oFont10b )
Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.633 ),  Transform( nPrice, "
99,999" ), oFont10b )  ////
Case nPrice >= 100 .and. nPrice < 1000
    oPRINT:SAY ( LINE, (oPrint:nHorzRes()* .626  ), Transform( nPrice, "
99,999" ), oFont10b )  //////
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.625 ),  Transform( nPrice, "
9,999" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.625  ), Transform( nPrice, "
99,999" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.625  ), Transform( nPrice, "
99,999" ), oFont10b )
EndCase

cText := "
Miles @"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.68), cText, oFONT10 )

nPrice := If(empty(oRsTrav:Fields("
MRate"):Value), 0.000, oRsTrav:Fields("MRate"):Value )

// mileage rate
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.778  ), Transform( nPrice, "
9.999" ), oFONT10b  )
cText := "
= $"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.85 ), cText, oFONT10 )

// mileage total
nPrice := If(empty(oRsTrav:Fields("
TMileage"):Value), 0.00, oRsTrav:Fields("TMileage"):Value )
Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.9238 ),Transform( nPrice, "
999,999.99" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.92 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10 .and. nPrice < 100

     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.92 ),Transform( nPrice, "
999,999.99" ), oFont10b )

Case nPrice >= 100 .and. nPrice < 1000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.915 ), Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.91), Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), Transform( nPrice, "
999,999.99" ), oFont10b )
  OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), Transform( nPrice, "
999,999.99" ), oFont10b )
EndCase


cTrainTp1  := if(empty(oRsTrav:Fields("
TrainTp1"):Value),space(25), substr(oRsTrav:Fields("TrainTp1"):Value+space(25),1,25))
cTrainTp2  := if(empty(oRsTrav:Fields("
TrainTp2"):Value),space(25), substr(oRsTrav:Fields("TrainTp2"):Value+space(25),1,25))
cTrainTp3  := if(empty(oRsTrav:Fields("
TrainTp3"):Value),space(25), substr(oRsTrav:Fields("TrainTp3"):Value+space(25),1,25))
cTrainTp4  := if(empty(oRsTrav:Fields("
TrainTp4"):Value),space(25), substr(oRsTrav:Fields("TrainTp4"):Value+space(25),1,25))
cTrainTp5  := if(empty(oRsTrav:Fields("
TrainTp5"):Value),space(25), substr(oRsTrav:Fields("TrainTp5"):Value+space(25),1,25))
cTrainTp6  := if(empty(oRsTrav:Fields("
TrainTp6"):Value),space(25), substr(oRsTrav:Fields("TrainTp6"):Value+space(25),1,25))


Line += oFont10b:nHeight
cText := If(empty(oRsTrav:Fields("
Quality"):Value), "N", oRsTrav:Fields("Quality"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10b )
cText := cTrainTp1
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.05), cText, oFONT10 )
oPrint:Line( line, (oPrint:nHorzRes()*.02 ), line, (oPrint:nHorzRes()*.45 ), oPen1 )     // line


cText := If(empty(oRsTrav:Fields("
ExamTrav"):Value), "N", oRsTrav:Fields("ExamTrav"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.23), cText, oFONT10b )
cText := cTrainTp4
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.26 ), cText, oFONT10 )                /////////////////
cText := "
Registration or Course Cost"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.55), cText, oFONT10 )
nPrice := If(empty(oRsTrav:Fields("
Regist"):Value), 0.00, oRsTrav:Fields("Regist"):Value )
Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()* .9238 ),Transform( nPrice, "
999,999.99" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.92 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.917 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 100 .and. nPrice < 1000
   oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.915), Transform( nPrice, "
999,999.99" ), oFont10b )

Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.91), Transform( nPrice, "
999,999.99" ), oFont10b )

  Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), Transform( nPrice, "
999,999.99" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), Transform( nPrice, "
999,999.99" ), oFont10b )
EndCase

Line += oFont10b:nHeight

cText := If(empty(oRsTrav:Fields("
Mgmt"):Value), "N", oRsTrav:Fields("Mgmt"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10b )
cText := cTrainTp2
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.05), cText, oFONT10 )

cText := If(empty(oRsTrav:Fields("
ProDev"):Value), "N", oRsTrav:Fields("ProDev"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.23), cText, oFONT10b )
cText := cTrainTp5
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.26 ), cText, oFONT10 )

cText := "
Airfare"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.55), cText, oFONT10 )
nPrice := If(empty(oRsTrav:Fields("
Airfare"):Value), 0.00, oRsTrav:Fields("Airfare"):Value )
Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()* .9238 ),Transform( nPrice, "
999,999.99" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.92 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.917 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 100 .and. nPrice < 1000
   oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.915), Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.91), Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), Transform( nPrice, "
999,999.99" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), Transform( nPrice, "
999,999.99" ), oFont10b )
EndCase

Line += oFont10b:nHeight

cText := If(empty(oRsTrav:Fields("
Tech"):Value), "N", oRsTrav:Fields("Tech"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10b )
cText := cTrainTp3
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.05), cText, oFONT10 )
cText := If(empty(oRsTrav:Fields("
Conf"):Value), "N", oRsTrav:Fields("Conf"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.23), cText, oFONT10b )

cText := cTrainTp6
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.26 ), cText, oFONT10 )
cText := "
Misc, Other, Baggage"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.55), cText, oFONT10 )
nPrice := If(empty(oRsTrav:Fields("
MiscCost"):Value), 0.00, oRsTrav:Fields("MiscCost"):Value )
Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()* .9238 ),Transform( nPrice, "
999,999.99" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.92 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.918 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 100 .and. nPrice < 1000
   oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.915), Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.91), Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), Transform( nPrice, "
999,999.99" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), Transform( nPrice, "
999,999.99" ), oFont10b )
EndCase
Line += oFont10b:nHeight
Line += oFont10b:nHeight
oPrint:Line( line, (oPrint:nHorzRes()*.55 ), line, (oPrint:nHorzRes()*.9792), oPen1 )     // bottom expense line

cText := "
Grand Total"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.80), cText, oFONT10 )

nPrice := If(empty(oRsTrav:Fields("
GrandTot"):Value), 0.00, oRsTrav:Fields("GrandTot"):Value )
Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()* .9238 ),Transform( nPrice, "
999,999.99" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.92 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.918 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 100 .and. nPrice < 1000
   oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.915), Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.91), Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), Transform( nPrice, "
999,999.99" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), Transform( nPrice, "
999,999.99" ), oFont10b )
EndCase

xLine := line

Line += oFont10b:nHeight-5
cText := "
========="
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.90), cText, oFONT10 )

Line := xLine

*Line += oFont10b:nHeight
Line += oFont10b:nHeight
cText := "
What knowledge transfer activity will be Completed ( Y/N )"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10 )
Line += oFont10b:nHeight
cText := "
For All that Apply"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10 )

Line += oFont10b:nHeight
cText := If(empty(oRsTrav:Fields("
OverView"):Value), "N", oRsTrav:Fields("OverView"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10b )
cText := "
Written Overview of Event and ( key Take Aways )"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.05), cText, oFONT10 )
oPrint:Line( line, (oPrint:nHorzRes()*.02 ), line, (oPrint:nHorzRes()*.45 ), oPen1 )     // line

cText := "
Manager Approval"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.55), cText, oFONT10 )
cText := "
Date"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.78), cText, oFONT10 )
cText := "
Approved(Y/N)"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.87), cText, oFONT10 )
Line += oFont10b:nHeight

oPrint:Line( line, (oPrint:nHorzRes()*.55 ), line, (oPrint:nHorzRes()*.9792), oPen1 )
cText := If(empty(oRsTrav:Fields("
LunchLrn"):Value), "N", oRsTrav:Fields("LunchLrn"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10b )
cText := "
Lunch and Learn Presented or afforded to DOI"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.05), cText, oFONT10 )

cText := If(empty(oRsTrav:Fields("
Mgr1"):Value), " ", UpperLower(oRsTrav:Fields("Mgr1"):Value ))
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.55), cText, oFONT10b )
dDate := If(empty(oRsTrav:Fields("
Mgr1Date"):Value),ctod("00/00/00"),;
                    TtoDate(oRsTrav:Fields("
Mgr1Date"):Value))
cText := dtoc(dDate)
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.78), cText, oFONT10b )

cText := If( empty(oRsTrav:Fields("
Mgr1Yes"):Value), " ",  oRsTrav:Fields("Mgr1Yes"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.92), cText, oFONT10b )
Line += oFont10b:nHeight
oPrint:Line( line, (oPrint:nHorzRes()*.55 ), line, (oPrint:nHorzRes()*.9792), oPen1 )

cText := If(empty(oRsTrav:Fields("
OtherTBD"):Value), "N", oRsTrav:Fields("OtherTBD"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10b )
cText := "
Other ( TBD upon consultation with Supervisor"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.05), cText, oFONT10 )

cText := If(empty(oRsTrav:Fields("
Mgr2"):Value), " ", UpperLower(oRsTrav:Fields("Mgr2"):Value ))
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.55), cText, oFONT10b )

dDate := If(empty(oRsTrav:Fields("
Mgr2Date"):Value),ctod("00/00/00"),;
                    TtoDate(oRsTrav:Fields("
Mgr2Date"):Value))
cText := dtoc(dDate)
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.78), cText, oFONT10b )

cText := If( empty(oRsTrav:Fields("
Mgr2Yes"):Value), " ",  oRsTrav:Fields("Mgr2Yes"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.92), cText, oFONT10b )

Line += oFont10b:nHeight
oPrint:Line( line, (oPrint:nHorzRes()*.55 ), line, (oPrint:nHorzRes()*.9792), oPen1 )

cText := If(empty(oRsTrav:Fields("
NotApp"):Value), "N", oRsTrav:Fields("NotApp"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10b )
cText := "
None or Not Applicable"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.05), cText, oFONT10 )

cText := If(empty(oRsTrav:Fields("
Mgr3"):Value), " ", UpperLower(oRsTrav:Fields("Mgr3"):Value) )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.55), cText, oFONT10b )

dDate := If(empty(oRsTrav:Fields("
Mgr3Date"):Value),ctod("00/00/00"),;
                    TtoDate(oRsTrav:Fields("
Mgr3Date"):Value))
cText := dtoc(dDate)
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.78), cText, oFONT10b )

Line += oFont10b:nHeight
oPrint:Line( line, (oPrint:nHorzRes()*.55 ), line, (oPrint:nHorzRes()*.9792), oPen1 )


cText := If(empty(oRsTrav:Fields("
Mgr4"):Value), " ", UpperLower(oRsTrav:Fields("Mgr4"):Value) )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.55), cText, oFONT10b )

dDate := If(empty(oRsTrav:Fields("
Mgr4Date"):Value),ctod("00/00/00"),;
                    TtoDate(oRsTrav:Fields("
Mgr4Date"):Value))
cText := dtoc(dDate)
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.78), cText, oFONT10b )

Line += oFont10b:nHeight
oPrint:Line( line, (oPrint:nHorzRes()*.55 ), line, (oPrint:nHorzRes()*.9792), oPen1 )

Line += oFont10b:nHeight
cText := "
Fiscal Yr"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10 )
cText := "
Amount"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.19), cText, oFONT10 )
cText := "
Continuing Ed Hours"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.30), cText, oFONT10 )
Line += oFont10b:nHeight
oPrint:Line( line, (oPrint:nHorzRes()*.02 ), line, (oPrint:nHorzRes()*.45 ), oPen1 )

xLine := Line                             // .38               1.70                      .81
oPrint:Box( line, (oPrint:nHorzRes()* .60 ), Line* 1.15, (oPrint:nHorzRes()*.98 ),  oPen1 )

cText := oRsTrav:Fields("
Comments"):Value    // rejection

If Empty(cText) .or. cText = "
 "
Else

   cText := Alltrim( cText)
   nLinCnt := MlCount( cText, 65 )

   IF nLinCnt > 0
      For x := 1 to nLinCnt
          yText := MemoLine( cText, 65, x )
          oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.61 ), yText, oFONT8 )
          Line += oFont8:nHeight
      Next
   Endif

Endif

Line := xLine

cText := If(empty(oRsTrav:Fields("
CurrFY"):Value), " ", oRsTrav:Fields("CurrFy"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10 )

nPrice := If(empty(oRsTrav:Fields("
CurrCont"):Value), 0.00, oRsTrav:Fields("CurrCont"):Value )
Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.19 ),Transform( nPrice, "
999,999.99" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.19 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.185 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 100 .and. nPrice < 1000
   oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.181), Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.178), Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.173), Transform( nPrice, "
999,999.99" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.19), Transform( nPrice, "
999,999.99" ), oFont10b )
EndCase

nPrice := If(empty(oRsTrav:Fields("
CurrHrs"):Value), 0, oRsTrav:Fields("CurrHrs"):Value )
Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.353 ),Transform( nPrice, "
999,999" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.353 ),Transform( nPrice, "
999,999" ), oFont10b )
Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.350 ),Transform( nPrice, "
999,999" ), oFont10b )
Case nPrice >= 100 .and. nPrice < 1000
   oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.345), Transform( nPrice,   "
999,999" ), oFont10b )
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.342), Transform( nPrice, "
999,999" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.338), Transform( nPrice, "
999,999" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.19), Transform( nPrice, "
999,999" ), oFont10b )
EndCase

Line += oFont10b:nHeight

cText := If(empty(oRsTrav:Fields("
PrevFY"):Value), " ", oRsTrav:Fields("PrevFy"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFONT10 )

nPrice := If(empty(oRsTrav:Fields("
PrevCont"):Value), 0.00, oRsTrav:Fields("PrevCont"):Value )
Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.19 ),Transform( nPrice, "
999,999.99" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.19 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.185 ),Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 100 .and. nPrice < 1000
   oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.181), Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.178), Transform( nPrice, "
999,999.99" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.173), Transform( nPrice, "
999,999.99" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.19), Transform( nPrice, "
999,999.99" ), oFont10b )
EndCase

nPrice := If(empty(oRsTrav:Fields("
PrevHrs"):Value), 0, oRsTrav:Fields("PrevHrs"):Value )
Do Case
Case nPrice = 0
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.353 ),Transform( nPrice, "
999,999" ), oFONT10b  )
Case nPrice > 0 .and. nPrice < 10
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.353 ),Transform( nPrice, "
999,999" ), oFont10b )
Case nPrice >= 10 .and. nPrice < 100
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.350 ),Transform( nPrice, "
999,999" ), oFont10b )
Case nPrice >= 100 .and. nPrice < 1000
   oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.345), Transform( nPrice,   "
999,999" ), oFont10b )
Case nPrice >= 1000 .and. nPrice < 10000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.342), Transform( nPrice, "
999,999" ), oFont10b )
Case nPrice >= 10000 .and. nPrice < 100000
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.338), Transform( nPrice, "
999,999" ), oFont10b )
OtherWise
     oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.19), Transform( nPrice, "
999,999" ), oFont10b )
EndCase

cText := "
Rejection"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.50), cText, oFont10 )
Line += oFont10b:nHeight
cText := "
Comments"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.50), cText, oFont10 )



*Line += oFont10b:nHeight
Line += oFont10b:nHeight
Line += oFont10b:nHeight
Line += oFont10b:nHeight


oPrint:Line( line, (oPrint:nHorzRes()*.02 ), line, (oPrint:nHorzRes()*.45 ), oPen1 )
Line += oFont10b:nHeight
cText := "
Created By"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.02), cText, oFont10 )
dDate := If(empty(oRsTrav:Fields("
CreateDt"):Value),ctod("00/00/00"),;
                    TtoDate(oRsTrav:Fields("
CreateDt"):Value))
cText := dtoc(dDate)
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.169), cText, oFONT10b )

cText := "
Fiscal Year"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.33), cText, oFONT10 )
Line += oFont10b:nHeight
cText := If(empty(oRsTrav:Fields("
CreateBy"):Value), " ", oRsTrav:Fields("CreateBy"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.169), lower(cText), oFONT10b )

cText := If(empty(oRsTrav:Fields("
FiscalYr"):Value), " ", oRsTrav:Fields("FiscalYr"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.35), cText, oFONT10b )

cText := "
Final Close Info :"
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.60), cText, oFONT10 )

cText := If(empty(oRsTrav:Fields("
Fanswer"):Value), " ", oRsTrav:Fields("Fanswer"):Value )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.73), cText, oFONT10b )

dDate := If(empty(oRsTrav:Fields("
FDate"):Value),ctod("00/00/00"),;
                    TtoDate(oRsTrav:Fields("
FDate"):Value))
cText := dtoc(dDate)
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.85), cText, oFONT10b )

oPRINT:EndPage()

/*
Do Case
Case nView = 1   // view
   oPRINT:Preview()
Case nView = 2
   PrintEnd()
Case nView = 3
   PRINT TO oPrint FILE "
C:\DBTMP\RICK.PDF"

  * FWSavePreviewToPDF( oPrint, "
c:\dbtmp\Rick.pdf", .F. )
  *   SavePreviewToPDF( oPrint, "
c:\dbtmp\Rick.pdf", .F. )

EndCase
*/

ENDPRINT


RELEASE FONT oFont8
RELEASE FONT oFont8b
RELEASE FONT oFont10
RELEASE FONT oFont10b
RELEASE FONT oFont10i
RELEASE FONT oFont12ib
RELEASE FONT oFont12b
RELEASE FONT oFont14b
RELEASE FONT oFont24b

RELEASE FONT oFont10d

RELEASE PEN oPen1

Try
  oDLg:End()
Catch
ENd Try

Return(cEmail)

//-----------------
Static Func prntline( pLINE, oFont, nColStep, Line, oPrint )

LOCAL i,nCol

nCol := 0

FOR i = 1 to LEN(pLINE)
    oPRINT:SAY ( LINE, nCOL, SUBSTR(pLINE,i,1) , oFont )
    nCOL += nColStep
NEXT
*Line += nRowStep

RETURN(.T.)

// end


Pictures of two .pdfs .. same code, different machines ...
Good resolution:
Image

Bad resolution:Image
Last edited by Rick Lipkin on Thu Oct 14, 2021 9:19 pm, edited 1 time in total.
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Unattended creation of .pdf .. resolution problem -- Rao

Postby Rick Lipkin » Sat Sep 18, 2021 12:58 pm

Any Help . Any Ideas ?? Thanks, Rick
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Unattended creation of .pdf .. resolution problem -- Rao

Postby karinha » Sat Sep 18, 2021 1:27 pm

Sorry, there's no way to help you, it's not possible to compile. Create a template, which can be compiled into \samples please.

Error: Unresolved external '_HB_FUN_TTODATE'
Error: Unresolved external '_HB_FUN_UPPERLOWER'


Code: Select all  Expand view  RUN

// \SAMPLES\RICK3.PRG

// ReqPrint1.prg

#Include "FiveWin.ch"

STATIC lOk

// -------------------------------------------
// Global Function to be used when request is Approved or Rejected
//
FUNCTION _ReqPrint1( nView, oDlg, oSay, cSay, oRsTrav )     // cToPrf

   LOCAL oPrint
   LOCAL oFont8, oFont8b, oFont10, oFont10b, ofont12ib, oFont12b, oFOnt14, ;
         oFont24b, oFont10d, oFont10i
   LOCAL oPen1, nLines, nPages, nMargin, nPage
   LOCAL nRowStep, nColStep
   LOCAL cHead1, cHead2, cText, yText, nPrice
   LOCAL xLine, nLinCnt, i
   LOCAL dDate

   LOCAL  cTrainTp1, cTrainTp2, cTrainTp3, cTrainTp4, cTrainTp5, cTrainTp6
   LOCAL cLogin, cEmail, nStart
   LOCAL dLeave, dReturn
   LOCAL cPdfName, cReplace

   cEmail := oRsTrav:Fields( "EmpEmail" ):Value

   IF Empty( cEmail )
      cEmail := AllTrim( xLogin )
   ELSE
      nStart := At( "@", cEmail )
      cEmail := SubStr( cEmail, 1, nStart - 1 )
   ENDIF

   cPdfName := cEmail

   dLeave   := If( Empty( oRsTrav:Fields( "Leave" ):Value ), CToD( "00/00/00" ), ;
      TtoDate( oRsTrav:Fields( "Leave" ):Value ) )

   dReturn  := If( Empty( oRsTrav:Fields( "Return" ):Value ), CToD( "00/00/00" ), ;
      TtoDate( oRsTrav:Fields( "Return" ):Value ) )

   cPdfName := cPdfName + "_" + DToC( dLeave ) + "_To_" + DToC( dReturn )
   cReplace := StrTran( cPdfName, "/", "-" )

   cPdfName := cReplace

   // msginfo( "cPdfName in Request "+cPdfName )

   // nView := 3

   DO CASE
   CASE nVIEW = 1
      PRINTER oPRINT FROM USER                ;
         PREVIEW MODAL                           ;
         NAME "Request Print Routine " + xLOGIN

      IF Empty( oPRINT:hDC )
         MsgStop ( "Printer not Ready !" )
         CLOSE DATABASES
         oDlg:END()
         RETURN( NIL )
      ENDIF

   CASE nVIEW = 2

      PRINTER oPRINT FROM USER                ;
         NAME "Request Print Routine for " + xLOGIN

      IF Empty( oPRINT:hDC )
         MsgStop ( "Printer not Ready !" )
         CLOSE DATABASES
         oDlg:END()
         RETURN( NIL )
      ENDIF

   CASE nVIEW = 3

      PRINT oPrint FILE "c:\dbtmp\" + cPdfName + ".pdf"

   ENDCASE

   oFont8    := TFont():New( "
Times New Roman", 0, - 8, .F., .F., , , , .F.,,,,,,, oPRINT, )
   oFont8b   := TFont():New( "
Times New Roman", 0, - 8, .F., .T., , , , .F.,,,,,,, oPRINT, )
   oFont10   := TFont():New( "
Arial",           0, - 9, .F., .F., , , , .F.,,,,,,, oPRINT, ) // -10
   oFont10b  := TFont():New( "
Times New Roman", 0, - 10, .F., .T., , , , .F.,,,,,,, oPRINT, )
   oFont10i  := TFont():New( "
Times New Roman", 0, - 10, .F., .T., , , , .T.,,,,,,, oPRINT, )
   oFont12ib := TFont():New( "
Times New Roman", 0, - 12, .F., .T., , , , .T.,,,,,,, oPRINT, )
   oFont12b  := TFont():New( "
Times New Roman", 0, - 12, .F., .T., , , , .F.,,,,,,, oPRINT, )
   oFont14b  := TFont():New( "
Times New Roman", 0, - 14, .F., .T., , , , .F.,,,,,,, oPRINT, )
   oFont24b  := TFont():New( "
Times New Roman", 0, - 24, .F., .T., , , , .F.,,,,,,, oPRINT, )

   oFont10d  := TFont():New(  "
Courier New",    0, - 10, .F., .T., , , , .F.,,,,,,, oPRINT, )

   DEFINE PEN oPen1 WIDTH 1 // 5 //10

   nLines    := 0
   nPages    := 1

   nRowStep := oPrint:nVertRes() / 55      // pixel per line = 57.65 @ 55
   nColStep := oPrint:nHorzRes() / 130      // columns

   oPRINT:StartPage()

   nMargin := Int( oPrint:nLogPixelX() * 0.2 )
   LINE    := nMargin
   nPage   := 1

   cHead1 := "
State of South Carolina Department of Insurance"
   cHead2 := "
Travel / Training Request Form"

   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .25 ), cHead1, oFONT14b )
   Line += oFont12b:nHeight
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .34 ), cHead2, oFONT14b )
   Line += oFont12b:nHeight
   Line += oFont12b:nHeight

   oPrint:Line( line, ( oPrint:nHorzRes() * .02 ), line, ( oPrint:nHorzRes() * .9792 ), oPen1 )   // top line

   Line += oFont12b:nHeight
   cText := "
Is this Associated with a"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10 )
   cText := If( Empty( oRsTrav:Fields( "
PrevAppr" ):Value ), " ", oRsTrav:Fields( "PrevAppr" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .21 ), cText, oFONT10b )

   Line += oFont10b:nHeight
   cText := "
Previously approved"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10 )
   Line += oFont10b:nHeight
   cText := "
Designation (Y/N)"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10 )

   Line -= oFont14b:nHeight + 5
   Line -= oFont8b:nHeight - 12

   cText := "
If Yes, Please list"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .25 ), cText, oFONT10 )
   Line += oFont10b:nHeight
   cText := "
Designation"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .25 ), cText, oFONT10 )
   Line += oFont10b:nHeight
   cText := "
( 200 char )"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .25 ), cText, oFONT10 )

   Line -= oFont14b:nHeight + 22
   oPrint:Box( line, ( oPrint:nHorzRes() * .38 ), Line * 1.70, ( oPrint:nHorzRes() * .81 ),  oPen1 )    // designation box

   xLine := Line
   cText := oRsTrav:Fields( "
Design" ):Value

   IF Empty( cText ) .OR. cText = "
 "
   ELSE

      Line += oFont8:nHeight - 10

      cText := AllTrim( cText )
      nLinCnt := MLCount( cText, 75 )

      IF nLinCnt > 0
         FOR x := 1 TO nLinCnt
            yText := MemoLine( cText, 75, x )
            oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .39 ), yText, oFONT8 )
            Line += oFont8:nHeight
         NEXT
      ENDIF

   ENDIF

   Line := xLine

   cText := "
In State    (Y/N)"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .82 ), cText, oFONT10 )
   cText := If( Empty( oRsTrav:Fields( "
InState" ):Value ), " ", oRsTrav:Fields( "Instate" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .96 ), cText, oFONT10b )

   Line += oFont12b:nHeight + 20

   Line -= oFont14b:nHeight + 4
   Line += oFont14b:nHeight// +20
   Line += oFont10b:nHeight

   cText := "
Out State (Y/N)"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .82 ), cText, oFONT10 )
   cText := If( Empty( oRsTrav:Fields( "
OutState" ):Value ), " ", oRsTrav:Fields( "OutState" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .96 ), cText, oFONT10b )
   Line += oFont12b:nHeight + 20

   Line += oFont12b:nHeight + 20
   Line += oFont12b:nHeight + 3

   cText := "
Date Leaving or Starting   :"

   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10 )

   dDate := If( Empty( oRsTrav:Fields( "
Leave" ):Value ), CToD( "00/00/00" ), ;
      TtoDate( oRsTrav:Fields( "
Leave" ):Value ) )

   cText := DToC( dDate )

   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .25 ), cText, oFONT10b )

   cText := "
Vendor / Sponsor    :"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .38 ), cText, oFONT10 )
   cText := If( Empty( oRsTrav:Fields( "
Sponsor" ):Value ), " ", oRsTrav:Fields( "Sponsor" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .55 ), cText, oFONT10b )

   Line += oFont10b:nHeight
   cText := "
Date Returning or Ending :"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10 )
   dDate := If( Empty( oRsTrav:Fields( "
Return" ):Value ), CToD( "00/00/00" ), ;
      TtoDate( oRsTrav:Fields( "
Return" ):Value ) )
   cText := DToC( dDate )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .25 ), cText, oFONT10b )

   cText := "
Conference / Event :"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .38 ), cText, oFONT10 )
   cText := If( Empty( oRsTrav:Fields( "
Event" ):Value ), " ", oRsTrav:Fields( "Event" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .55 ), cText, oFONT10b )

   // employee name
   Line += oFont10b:nHeight
   cText := "
Emp Name   :"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10 )
   cText := If( Empty( oRsTrav:Fields( "
Employee" ):Value ), " ", oRsTrav:Fields( "EMployee" ):Value )
   cText := UpperLower( cText )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .13 ), cText, oFONT10b )

   cText := "
Location                   :"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .38 ), cText, oFONT10 )
   cText := If( Empty( oRsTrav:Fields( "
Location" ):Value ), " ", oRsTrav:Fields( "Location" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .55 ), cText, oFONT10b )

   Line += oFont10b:nHeight
   cText := "
Emp E-Mail   :"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10 )
   cText := If( Empty( oRsTrav:Fields( "
EmpEmail" ):Value ), " ", oRsTrav:Fields( "EmpEmail" ):Value )
   cText := Lower( cText )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .13 ), cText, oFONT10b )

   Line += oFont8:nHeight
   cText := "
Meals"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .55 ), cText, oFONT10 )
   cText := "
Cost"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .783 ), cText, oFONT10 )
   cText := "
Total"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .94 ), cText, oFONT10 )

   Line -= oFont8:nHeight
   Line += oFont10b:nHeight
   Line += oFont10b:nHeight

   cText := "
Purpose or"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10 )

   // number of breakfasts --------------------------

   nPrice := If( Empty( oRsTrav:Fields( "
Break" ):Value ), 0, oRsTrav:Fields( "Break" ):Value )

   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .565  ), Transform( nPrice, "
9,999" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .565 ), Transform( nPrice, "
9,999" ), oFont10b )
   CASE nPrice >= 10 .AND. nPrice < 100

      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .56  ), Transform( nPrice, "
9,999" ), oFont10b )

   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .556 ), Transform( nPrice, "
9,999" ), oFont10b )
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .55  ), Transform( nPrice, "
9,999" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .54  ), Transform( nPrice, "
99,999" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .54  ), Transform( nPrice, "
99,999" ), oFont10b )
   ENDCASE

   oPrint:Line( line, ( oPrint:nHorzRes() * .55 ), line, ( oPrint:nHorzRes() * .9792 ), oPen1 )   // top line

   // BREAKFAST -----------------------------------------------

   cText := "
Breakfasts  x"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .62 ), cText, oFONT10 )
   nPrice := If( Empty( oRsTrav:Fields( "
BreakC" ):Value ), 0.00, oRsTrav:Fields( "BreakC" ):Value )

   // breakfast cost

   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .77  ), Transform( nPrice, "
9,999.99" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .77 ), Transform( nPrice, "
9,999.99" ), oFont10b )  // ///
   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .77  ), Transform( nPrice, "
9,999.99" ), oFont10b )
   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .62 ), Transform( nPrice, "
9,999.99" ), oFont10b )
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .62  ), Transform( nPrice, "
9,999.99" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .60  ), Transform( nPrice, "
99,999.99" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .60  ), Transform( nPrice, "
99,999.99" ), oFont10b )
   ENDCASE

   cText := "
= $"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .85 ), cText, oFONT10 )

   // breakfast totals

   nPrice := If( Empty( oRsTrav:Fields( "
BreakT" ):Value ), 0.00, oRsTrav:Fields( "BreakT" ):Value )

   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .9238 ), Transform( nPrice, "
999,999.99" ), oFONT10b  )    // .92
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .9238 ), Transform( nPrice, "
999,999.99" ), oFont10b )
      // 92
   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .92 ), Transform( nPrice, "
999,999.99" ), oFont10b )     // ///////
   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .915 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .91 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .91 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   ENDCASE

   oPrint:Box( line, ( oPrint:nHorzRes() * .11 ), Line * 1.28, ( oPrint:nHorzRes() * .54 ),  oPen1 )    // purpose or benefits box

   Line += oFont10b:nHeight
   cText := "
Benefits"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10 )

   // LUNCH --------------------------------------------------
   // number of lunches
   nPrice := If( Empty( oRsTrav:Fields( "
Lunch" ):Value ), 0, oRsTrav:Fields( "Lunch" ):Value )

   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .565  ), Transform( nPrice, "
9,999" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .565 ), Transform( nPrice, "
9,999" ), oFont10b )
   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .56  ), Transform( nPrice, "
9,999" ), oFont10b )
   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .556 ), Transform( nPrice, "
9,999" ), oFont10b )
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .55  ), Transform( nPrice, "
9,999" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .54  ), Transform( nPrice, "
99,999" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .54  ), Transform( nPrice, "
99,999" ), oFont10b )
   ENDCASE

   // lunch cost
   cText := "
Lunches     x"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .62 ), cText, oFONT10 )

   nPrice := If( Empty( oRsTrav:Fields( "
LunchC" ):Value ), 0.00, oRsTrav:Fields( "LunchC" ):Value )

   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .77  ), Transform( nPrice, "
9,999.99" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .62 ), Transform( nPrice, "
9,999.99" ), oFont10b )

   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .765 ), Transform( nPrice, "
9,999.99" ), oFont10b )

   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .62 ), Transform( nPrice, "
9,999.99" ), oFont10b )
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .62  ), Transform( nPrice, "
9,999.99" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .60  ), Transform( nPrice, "
99,999.99" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .60  ), Transform( nPrice, "
99,999.99" ), oFont10b )
   ENDCASE

   cText := "
= $"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .85 ), cText, oFONT10 )

   // lunch totals
   nPrice := If( Empty( oRsTrav:Fields( "
LunchT" ):Value ), 0.00, oRsTrav:Fields( "LunchT" ):Value )

   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .9238 ), Transform( nPrice, "
999,999.99" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .92 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .92 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .915 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .91 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   ENDCASE


   Line += oFont10b:nHeight
   cText := "
(200) char"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10 )

   // number of dinner meals

   nPrice := If( Empty( oRsTrav:Fields( "
Dinner" ):Value ), 0, oRsTrav:Fields( "Dinner" ):Value )

   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .565  ), Transform( nPrice, "
9,999" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .565 ), Transform( nPrice, "
9,999" ), oFont10b )
   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .56  ), Transform( nPrice, "
9,999" ), oFont10b )
   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .556 ), Transform( nPrice, "
9,999" ), oFont10b )
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .55  ), Transform( nPrice, "
9,999" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .54  ), Transform( nPrice, "
99,999" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .54  ), Transform( nPrice, "
99,999" ), oFont10b )
   ENDCASE

   // dinner cost

   cText := "
Dinners       x"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .62 ), cText, oFONT10 )
   nPrice := If( Empty( oRsTrav:Fields( "
DinnerC" ):Value ), 0.00, oRsTrav:Fields( "DinnerC" ):Value )

   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .77  ), Transform( nPrice, "
9,999.99" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .62 ), Transform( nPrice, "
9,999.99" ), oFont10b )

   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .765 ), Transform( nPrice, "
9,999.99" ), oFont10b )

   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .62 ), Transform( nPrice, "
9,999.99" ), oFont10b )
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .62  ), Transform( nPrice, "
9,999.99" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .60  ), Transform( nPrice, "
99,999.99" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .60  ), Transform( nPrice, "
99,999.99" ), oFont10b )
   ENDCASE


   cText := "
= $"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .85 ), cText, oFONT10 )


   // dinner totals

   nPrice := If( Empty( oRsTrav:Fields( "
DinnerT" ):Value ), 0.00, oRsTrav:Fields( "DinnerT" ):Value )

   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .9238 ), Transform( nPrice, "
999,999.99" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .92 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .92 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .915 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .91 ), Transform( nPrice, "
999,999.99" ), oFont10b )     // ///////////////
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   ENDCASE

   Line += oFont10b:nHeight
   Line += oFont10b:nHeight

   oPrint:Line( line, ( oPrint:nHorzRes() * .55 ), line, ( oPrint:nHorzRes() * .9792 ), oPen1 )   // bottom line  ------------------------------
   cText := "
Total for Meals"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .79 ), cText, oFONT10 )

   nPrice := If( Empty( oRsTrav:Fields( "
TMeals" ):Value ), 0.00, oRsTrav:Fields( "TMeals" ):Value )
   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .9238 ), Transform( nPrice, "
999,999.99" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .92 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .92 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .915 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .91 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   ENDCASE

   // recalc for Benefits comments
   xLine := line
   cText := oRsTrav:Fields( "
Benefits" ):Value

   IF Empty( cText ) .OR. cText = "
 "
   ELSE

      Line += oFont14b:nHeight - 200

      cText := AllTrim( cText )
      nLinCnt := MLCount( cText, 75 )

      IF nLinCnt > 0
         FOR x := 1 TO nLinCnt
            yText := MemoLine( cText, 75, x )
            oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .12 ), yText, oFONT8 )
            Line += oFont8:nHeight
         NEXT
      ENDIF

   ENDIF

   Line := xLine

   Line += oFont10b:nHeight
   Line += oFont10b:nHeight

   cText := "
Cont Ed Credits going to be Obtained (Y/N)?"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10 )
   cText := If( Empty( oRsTrav:Fields( "
ContEdCr" ):Value ), "N", oRsTrav:Fields( "ContEdCr" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .37 ), cText, oFONT10b )
   Line += oFont10b:nHeight
   cText := "
If YES, How Many ?"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10 )
   cText := If( Empty( oRsTrav:Fields( "
HowMany" ):Value ), 0, oRsTrav:Fields( "HowMany" ):Value )
   cText := Transform( cText, "
999" )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .364 ), cText, oFONT10b )
   Line += oFont10b:nHeight
   cText := "
Are you making a Speach or Presentation (Y/N) ?"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10 )
   cText := If( Empty( oRsTrav:Fields( "
Speach" ):Value ), "N", oRsTrav:Fields( "Speach" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .37 ), cText, oFONT10b )
   Line += oFont10b:nHeight

   cText := "
Hotel"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .55 ), cText, oFONT10 )
   nPrice := If( Empty( oRsTrav:Fields( "
Nights" ):Value ), 0, oRsTrav:Fields( "Nights" ):Value )

   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .64  ), Transform( nPrice, "
9,999" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .64 ),  Transform( nPrice, "
9,999" ), oFont10b )
   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .64 ),  Transform( nPrice, "
9,999" ), oFont10b )
   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .63  ), Transform( nPrice, "
9,999" ), oFont10b )  // ////
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .625 ),  Transform( nPrice, "
9,999" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .625  ), Transform( nPrice, "
99,999" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .625  ), Transform( nPrice, "
99,999" ), oFont10b )
   ENDCASE

   cText := "
Nights @"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .68 ), cText, oFONT10 )

   nPrice := If( Empty( oRsTrav:Fields( "
HCost" ):Value ), 0.00, oRsTrav:Fields( "HCost" ):Value )

   // hotel cost

   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .77  ), Transform( nPrice, "
9,999.99" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .77 ), Transform( nPrice, "
9,999.99" ), oFont10b )  // ///
   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .765  ), Transform( nPrice, "
9,999.99" ), oFont10b )
   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .765 ), Transform( nPrice, "
9,999.99" ), oFont10b )
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .62  ), Transform( nPrice, "
9,999.99" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .60  ), Transform( nPrice, "
99,999.99" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .60  ), Transform( nPrice, "
99,999.99" ), oFont10b )
   ENDCASE

   // hotel total dollars
   cText := "
= $"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .85 ), cText, oFONT10 )

   nPrice := If( Empty( oRsTrav:Fields( "
THotel" ):Value ), 0.00, oRsTrav:Fields( "THotel" ):Value )
   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .9238 ), Transform( nPrice, "
999,999.99" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .92 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .917 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .915 ), Transform( nPrice, "
999,999.99" ), oFont10b )

   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .91 ), Transform( nPrice, "
999,999.99" ), oFont10b )

   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   ENDCASE

   Line += oFont10b:nHeight

   cText := "
Type of Training (Y/N)?"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10 )
   cText := "
Mileage"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .55 ), cText, oFONT10 )

   // number of miles driven

   nPrice := If( Empty( oRsTrav:Fields( "
NumMiles" ):Value ), 0.000, oRsTrav:Fields( "NumMiles" ):Value )
   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .635  ), Transform( nPrice, "
99,999" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .635 ),  Transform( nPrice, "
99,999" ), oFont10b )
   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .633 ),  Transform( nPrice, "
99,999" ), oFont10b )  // //
   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .626  ), Transform( nPrice, "
99,999" ), oFont10b )  // ////
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .625 ),  Transform( nPrice, "
9,999" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .625  ), Transform( nPrice, "
99,999" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .625  ), Transform( nPrice, "
99,999" ), oFont10b )
   ENDCASE

   cText := "
Miles @"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .68 ), cText, oFONT10 )

   nPrice := If( Empty( oRsTrav:Fields( "
MRate" ):Value ), 0.000, oRsTrav:Fields( "MRate" ):Value )

   // mileage rate
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .778  ), Transform( nPrice, "
9.999" ), oFONT10b  )
   cText := "
= $"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .85 ), cText, oFONT10 )

   // mileage total
   nPrice := If( Empty( oRsTrav:Fields( "
TMileage" ):Value ), 0.00, oRsTrav:Fields( "TMileage" ):Value )
   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .9238 ), Transform( nPrice, "
999,999.99" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .92 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10 .AND. nPrice < 100

      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .92 ), Transform( nPrice, "
999,999.99" ), oFont10b )

   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .915 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .91 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   ENDCASE

   cTrainTp1  := if( Empty( oRsTrav:Fields( "
TrainTp1" ):Value ), Space( 25 ), SubStr( oRsTrav:Fields( "TrainTp1" ):Value + Space( 25 ), 1, 25 ) )
   cTrainTp2  := if( Empty( oRsTrav:Fields( "
TrainTp2" ):Value ), Space( 25 ), SubStr( oRsTrav:Fields( "TrainTp2" ):Value + Space( 25 ), 1, 25 ) )
   cTrainTp3  := if( Empty( oRsTrav:Fields( "
TrainTp3" ):Value ), Space( 25 ), SubStr( oRsTrav:Fields( "TrainTp3" ):Value + Space( 25 ), 1, 25 ) )
   cTrainTp4  := if( Empty( oRsTrav:Fields( "
TrainTp4" ):Value ), Space( 25 ), SubStr( oRsTrav:Fields( "TrainTp4" ):Value + Space( 25 ), 1, 25 ) )
   cTrainTp5  := if( Empty( oRsTrav:Fields( "
TrainTp5" ):Value ), Space( 25 ), SubStr( oRsTrav:Fields( "TrainTp5" ):Value + Space( 25 ), 1, 25 ) )
   cTrainTp6  := if( Empty( oRsTrav:Fields( "
TrainTp6" ):Value ), Space( 25 ), SubStr( oRsTrav:Fields( "TrainTp6" ):Value + Space( 25 ), 1, 25 ) )

   Line += oFont10b:nHeight
   cText := If( Empty( oRsTrav:Fields( "
Quality" ):Value ), "N", oRsTrav:Fields( "Quality" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10b )
   cText := cTrainTp1
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .05 ), cText, oFONT10 )
   oPrint:Line( line, ( oPrint:nHorzRes() * .02 ), line, ( oPrint:nHorzRes() * .45 ), oPen1 )     // line

   cText := If( Empty( oRsTrav:Fields( "
ExamTrav" ):Value ), "N", oRsTrav:Fields( "ExamTrav" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .23 ), cText, oFONT10b )
   cText := cTrainTp4
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .26 ), cText, oFONT10 )                // ///////////////
   cText := "
Registration or Course Cost"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .55 ), cText, oFONT10 )
   nPrice := If( Empty( oRsTrav:Fields( "
Regist" ):Value ), 0.00, oRsTrav:Fields( "Regist" ):Value )

   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .9238 ), Transform( nPrice, "
999,999.99" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .92 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .917 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .915 ), Transform( nPrice, "
999,999.99" ), oFont10b )

   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .91 ), Transform( nPrice, "
999,999.99" ), oFont10b )

   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   ENDCASE

   Line += oFont10b:nHeight

   cText := If( Empty( oRsTrav:Fields( "
Mgmt" ):Value ), "N", oRsTrav:Fields( "Mgmt" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10b )
   cText := cTrainTp2
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .05 ), cText, oFONT10 )

   cText := If( Empty( oRsTrav:Fields( "
ProDev" ):Value ), "N", oRsTrav:Fields( "ProDev" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .23 ), cText, oFONT10b )
   cText := cTrainTp5
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .26 ), cText, oFONT10 )

   cText := "
Airfare"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .55 ), cText, oFONT10 )
   nPrice := If( Empty( oRsTrav:Fields( "
Airfare" ):Value ), 0.00, oRsTrav:Fields( "Airfare" ):Value )

   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .9238 ), Transform( nPrice, "
999,999.99" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .92 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .917 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .915 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .91 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   ENDCASE

   Line += oFont10b:nHeight

   cText := If( Empty( oRsTrav:Fields( "
Tech" ):Value ), "N", oRsTrav:Fields( "Tech" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10b )
   cText := cTrainTp3
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .05 ), cText, oFONT10 )
   cText := If( Empty( oRsTrav:Fields( "
Conf" ):Value ), "N", oRsTrav:Fields( "Conf" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .23 ), cText, oFONT10b )

   cText := cTrainTp6
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .26 ), cText, oFONT10 )
   cText := "
Misc, Other, Baggage"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .55 ), cText, oFONT10 )
   nPrice := If( Empty( oRsTrav:Fields( "
MiscCost" ):Value ), 0.00, oRsTrav:Fields( "MiscCost" ):Value )

   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .9238 ), Transform( nPrice, "
999,999.99" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .92 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .918 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .915 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .91 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   ENDCASE

   Line += oFont10b:nHeight
   Line += oFont10b:nHeight
   oPrint:Line( line, ( oPrint:nHorzRes() * .55 ), line, ( oPrint:nHorzRes() * .9792 ), oPen1 )     // bottom expense line

   cText := "
Grand Total"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .80 ), cText, oFONT10 )

   nPrice := If( Empty( oRsTrav:Fields( "
GrandTot" ):Value ), 0.00, oRsTrav:Fields( "GrandTot" ):Value )

   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .9238 ), Transform( nPrice, "
999,999.99" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .92 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .918 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .915 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .91 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   ENDCASE

   xLine := line

   Line += oFont10b:nHeight - 5
   cText := "
========="
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .90 ), cText, oFONT10 )

   Line := xLine

   Line += oFont10b:nHeight
   cText := "
What knowledge transfer activity will be Completed ( Y/N )"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10 )
   Line += oFont10b:nHeight
   cText := "
For All that Apply"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10 )

   Line += oFont10b:nHeight
   cText := If( Empty( oRsTrav:Fields( "
OverView" ):Value ), "N", oRsTrav:Fields( "OverView" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10b )
   cText := "
Written Overview of Event and ( key Take Aways )"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .05 ), cText, oFONT10 )
   oPrint:Line( line, ( oPrint:nHorzRes() * .02 ), line, ( oPrint:nHorzRes() * .45 ), oPen1 )     // line

   cText := "
Manager Approval"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .55 ), cText, oFONT10 )
   cText := "
Date"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .78 ), cText, oFONT10 )
   cText := "
Approved(Y/N)"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .87 ), cText, oFONT10 )
   Line += oFont10b:nHeight

   oPrint:Line( line, ( oPrint:nHorzRes() * .55 ), line, ( oPrint:nHorzRes() * .9792 ), oPen1 )
   cText := If( Empty( oRsTrav:Fields( "
LunchLrn" ):Value ), "N", oRsTrav:Fields( "LunchLrn" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10b )
   cText := "
Lunch and Learn Presented or afforded to DOI"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .05 ), cText, oFONT10 )

   cText := If( Empty( oRsTrav:Fields( "
Mgr1" ):Value ), " ", UpperLower( oRsTrav:Fields( "Mgr1" ):Value ) )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .55 ), cText, oFONT10b )
   dDate := If( Empty( oRsTrav:Fields( "
Mgr1Date" ):Value ), CToD( "00/00/00" ), ;
      TtoDate( oRsTrav:Fields( "
Mgr1Date" ):Value ) )
   cText := DToC( dDate )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .78 ), cText, oFONT10b )

   cText := If( Empty( oRsTrav:Fields( "
Mgr1Yes" ):Value ), " ",  oRsTrav:Fields( "Mgr1Yes" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .92 ), cText, oFONT10b )
   Line += oFont10b:nHeight
   oPrint:Line( line, ( oPrint:nHorzRes() * .55 ), line, ( oPrint:nHorzRes() * .9792 ), oPen1 )

   cText := If( Empty( oRsTrav:Fields( "
OtherTBD" ):Value ), "N", oRsTrav:Fields( "OtherTBD" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10b )
   cText := "
Other ( TBD upon consultation with Supervisor"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .05 ), cText, oFONT10 )

   cText := If( Empty( oRsTrav:Fields( "
Mgr2" ):Value ), " ", UpperLower( oRsTrav:Fields( "Mgr2" ):Value ) )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .55 ), cText, oFONT10b )

   dDate := If( Empty( oRsTrav:Fields( "
Mgr2Date" ):Value ), CToD( "00/00/00" ), ;
      TtoDate( oRsTrav:Fields( "
Mgr2Date" ):Value ) )
   cText := DToC( dDate )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .78 ), cText, oFONT10b )

   cText := If( Empty( oRsTrav:Fields( "
Mgr2Yes" ):Value ), " ",  oRsTrav:Fields( "Mgr2Yes" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .92 ), cText, oFONT10b )

   Line += oFont10b:nHeight
   oPrint:Line( line, ( oPrint:nHorzRes() * .55 ), line, ( oPrint:nHorzRes() * .9792 ), oPen1 )

   cText := If( Empty( oRsTrav:Fields( "
NotApp" ):Value ), "N", oRsTrav:Fields( "NotApp" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10b )
   cText := "
None or Not Applicable"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .05 ), cText, oFONT10 )

   cText := If( Empty( oRsTrav:Fields( "
Mgr3" ):Value ), " ", UpperLower( oRsTrav:Fields( "Mgr3" ):Value ) )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .55 ), cText, oFONT10b )

   dDate := If( Empty( oRsTrav:Fields( "
Mgr3Date" ):Value ), CToD( "00/00/00" ), ;
      TtoDate( oRsTrav:Fields( "
Mgr3Date" ):Value ) )
   cText := DToC( dDate )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .78 ), cText, oFONT10b )

   Line += oFont10b:nHeight
   oPrint:Line( line, ( oPrint:nHorzRes() * .55 ), line, ( oPrint:nHorzRes() * .9792 ), oPen1 )


   cText := If( Empty( oRsTrav:Fields( "
Mgr4" ):Value ), " ", UpperLower( oRsTrav:Fields( "Mgr4" ):Value ) )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .55 ), cText, oFONT10b )

   dDate := If( Empty( oRsTrav:Fields( "
Mgr4Date" ):Value ), CToD( "00/00/00" ), ;
      TtoDate( oRsTrav:Fields( "
Mgr4Date" ):Value ) )
   cText := DToC( dDate )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .78 ), cText, oFONT10b )

   Line += oFont10b:nHeight
   oPrint:Line( line, ( oPrint:nHorzRes() * .55 ), line, ( oPrint:nHorzRes() * .9792 ), oPen1 )

   Line += oFont10b:nHeight
   cText := "
Fiscal Yr"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10 )
   cText := "
Amount"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .19 ), cText, oFONT10 )
   cText := "
Continuing Ed Hours"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .30 ), cText, oFONT10 )
   Line += oFont10b:nHeight
   oPrint:Line( line, ( oPrint:nHorzRes() * .02 ), line, ( oPrint:nHorzRes() * .45 ), oPen1 )

   xLine := Line                             // .38               1.70                      .81
   oPrint:Box( line, ( oPrint:nHorzRes() * .60 ), Line * 1.15, ( oPrint:nHorzRes() * .98 ),  oPen1 )

   cText := oRsTrav:Fields( "
Comments" ):Value    // rejection

   IF Empty( cText ) .OR. cText = "
 "
   ELSE

      cText := AllTrim( cText )
      nLinCnt := MLCount( cText, 65 )

      IF nLinCnt > 0
         FOR x := 1 TO nLinCnt
            yText := MemoLine( cText, 65, x )
            oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .61 ), yText, oFONT8 )
            Line += oFont8:nHeight
         NEXT
      ENDIF

   ENDIF

   Line := xLine

   cText := If( Empty( oRsTrav:Fields( "
CurrFY" ):Value ), " ", oRsTrav:Fields( "CurrFy" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10 )

   nPrice := If( Empty( oRsTrav:Fields( "
CurrCont" ):Value ), 0.00, oRsTrav:Fields( "CurrCont" ):Value )

   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .19 ), Transform( nPrice, "
999,999.99" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .19 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .185 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .181 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .178 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .173 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .19 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   ENDCASE

   nPrice := If( Empty( oRsTrav:Fields( "
CurrHrs" ):Value ), 0, oRsTrav:Fields( "CurrHrs" ):Value )

   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .353 ), Transform( nPrice, "
999,999" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .353 ), Transform( nPrice, "
999,999" ), oFont10b )
   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .350 ), Transform( nPrice, "
999,999" ), oFont10b )
   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .345 ), Transform( nPrice,   "
999,999" ), oFont10b )
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .342 ), Transform( nPrice, "
999,999" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .338 ), Transform( nPrice, "
999,999" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .19 ), Transform( nPrice, "
999,999" ), oFont10b )
   ENDCASE

   Line += oFont10b:nHeight

   cText := If( Empty( oRsTrav:Fields( "
PrevFY" ):Value ), " ", oRsTrav:Fields( "PrevFy" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFONT10 )

   nPrice := If( Empty( oRsTrav:Fields( "
PrevCont" ):Value ), 0.00, oRsTrav:Fields( "PrevCont" ):Value )

   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .19 ), Transform( nPrice, "
999,999.99" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .19 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .185 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .181 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .178 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .173 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .19 ), Transform( nPrice, "
999,999.99" ), oFont10b )
   ENDCASE

   nPrice := If( Empty( oRsTrav:Fields( "
PrevHrs" ):Value ), 0, oRsTrav:Fields( "PrevHrs" ):Value )

   DO CASE
   CASE nPrice = 0
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .353 ), Transform( nPrice, "
999,999" ), oFONT10b  )
   CASE nPrice > 0 .AND. nPrice < 10
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .353 ), Transform( nPrice, "
999,999" ), oFont10b )
   CASE nPrice >= 10 .AND. nPrice < 100
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .350 ), Transform( nPrice, "
999,999" ), oFont10b )
   CASE nPrice >= 100 .AND. nPrice < 1000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .345 ), Transform( nPrice,   "
999,999" ), oFont10b )
   CASE nPrice >= 1000 .AND. nPrice < 10000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .342 ), Transform( nPrice, "
999,999" ), oFont10b )
   CASE nPrice >= 10000 .AND. nPrice < 100000
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .338 ), Transform( nPrice, "
999,999" ), oFont10b )
   OTHERWISE
      oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .19 ), Transform( nPrice, "
999,999" ), oFont10b )
   ENDCASE

   cText := "
Rejection"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .50 ), cText, oFont10 )
   Line += oFont10b:nHeight
   cText := "
Comments"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .50 ), cText, oFont10 )

   Line += oFont10b:nHeight
   Line += oFont10b:nHeight
   Line += oFont10b:nHeight

   oPrint:Line( line, ( oPrint:nHorzRes() * .02 ), line, ( oPrint:nHorzRes() * .45 ), oPen1 )
   Line += oFont10b:nHeight
   cText := "
Created By"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .02 ), cText, oFont10 )
   dDate := If( Empty( oRsTrav:Fields( "
CreateDt" ):Value ), CToD( "00/00/00" ), ;
      TtoDate( oRsTrav:Fields( "
CreateDt" ):Value ) )
   cText := DToC( dDate )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .169 ), cText, oFONT10b )

   cText := "
Fiscal Year"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .33 ), cText, oFONT10 )
   Line += oFont10b:nHeight
   cText := If( Empty( oRsTrav:Fields( "
CreateBy" ):Value ), " ", oRsTrav:Fields( "CreateBy" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .169 ), Lower( cText ), oFONT10b )

   cText := If( Empty( oRsTrav:Fields( "
FiscalYr" ):Value ), " ", oRsTrav:Fields( "FiscalYr" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .35 ), cText, oFONT10b )

   cText := "
Final Close Info :"
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .60 ), cText, oFONT10 )

   cText := If( Empty( oRsTrav:Fields( "
Fanswer" ):Value ), " ", oRsTrav:Fields( "Fanswer" ):Value )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .73 ), cText, oFONT10b )

   dDate := If( Empty( oRsTrav:Fields( "
FDate" ):Value ), CToD( "00/00/00" ), ;
      TtoDate( oRsTrav:Fields( "
FDate" ):Value ) )
   cText := DToC( dDate )
   oPRINT:SAY ( LINE, ( oPrint:nHorzRes() * .85 ), cText, oFONT10b )

   oPRINT:EndPage()

   ENDPRINT

   RELEASE FONT oFont8
   RELEASE FONT oFont8b
   RELEASE FONT oFont10
   RELEASE FONT oFont10b
   RELEASE FONT oFont10i
   RELEASE FONT oFont12ib
   RELEASE FONT oFont12b
   RELEASE FONT oFont14b
   RELEASE FONT oFont24b

   RELEASE FONT oFont10d

   RELEASE PEN oPen1

   Try
      oDLg:End()
   Catch
   ENd Try

Return( cEmail )

STATIC FUNC prntline( pLINE, oFont, nColStep, Line, oPrint )

   LOCAL i, nCol

   nCol := 0

   FOR i = 1 TO Len( pLINE )

      oPRINT:SAY ( LINE, nCOL, SubStr( pLINE, i, 1 ), oFont )

      nCOL += nColStep

   NEXT

RETURN( .T. )

// end


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Unattended creation of .pdf .. resolution problem -- Rao

Postby ADutheil » Sun Sep 19, 2021 11:47 am

First thing I'd investigate is the default printer on each computer. I had a similar problem some years ago and if I remember well it was due to differences between printers ink jet/laser, portrait vs landscape etc. Unfortunatly I can't recall ATM.
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Unattended creation of .pdf .. resolution problem -- Rao

Postby nageswaragunupudi » Sun Sep 19, 2021 7:59 pm

After the PRINT command, please try setting paper size ( A4 or Letter ) and orientation to portrait.

In future programs, we advise you to use physical units like INCHES,CM,MM and let the printer class handle the complex calculations. That will be a lot easier.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Unattended creation of .pdf .. resolution problem -- Rao

Postby Rick Lipkin » Mon Sep 20, 2021 12:43 pm

Rao

Appreciate your advice this ( silent ) .pdf is created for standard 8.5 x 11 paper .. would you mind sending me the sample code for setting the paper size ?

May thinks!!

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Unattended creation of .pdf .. resolution problem -- Rao

Postby nageswaragunupudi » Mon Sep 20, 2021 8:57 pm

PRINT oPrn FILE cFilePdf
oPrn:SetPage( 1 ) // Letter size 8x11
oPrn:SetPortrait()

nWidth := oPrn:PageWidth( "INCHES" )
nHeight := oPrn:PageHeight( "INCHES" )

// nWidth and nHeight are in inches

Please see print.ch and find many useful commands for printing using physical units like INCHES/CM/MM

eg:
@ 1.5,0.5 PRINT TO oPrn TEXT cText SIZE 5 INCHES ALIGN "R" // right
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Unattended creation of .pdf .. resolution problem -- Rao

Postby Rick Lipkin » Tue Sep 21, 2021 12:32 pm

karinha

Here are the two functions that are missing from my code ... any help or advice would be gratefully appreciated ...

Rick Lipkin


Code: Select all  Expand view  RUN

//--------------------------


Function TtoDate( tDate )

If empty( tDate)
   Return( ctod("00/00/00"))
Endif

If ValType( tDate ) = "D"
   Return(tDate )
Endif

//------------------
Func UpperLower( cText )

Local nLen,i,cField

If empty( cText ) .or. cText = "  "
   Return(" ")
Endif

nLen  := len( cText )

For i = 1 to Len(cText)

   If i = 1
      cField := upper(substr(cText,i,1))
      Loop
   Endif

   // check for multiple words
   // use space as the delimeter

   If substr(cText,i,1) = space(1) // found a space in between words
      i++
      cField := cField+" "+upper(substr(cText,i,1))
      loop
   Else
      cField := cField+lower(substr(cText,i,1))
   Endif

Next

cText := cField

Return(cText)


 
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Unattended creation of .pdf .. resolution problem -- Rao

Postby nageswaragunupudi » Mon Sep 27, 2021 10:27 pm

Instead of UpperLower()
you can use
Code: Select all  Expand view  RUN

TokenUpper( Lower( cStr ) )
 


From FWH version 21.01 onwards, better to use
Code: Select all  Expand view  RUN

FW_ProperCase( cStr )
 


Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Unattended creation of .pdf . resolution problem -- RESOLVED

Postby Rick Lipkin » Thu Oct 14, 2021 9:51 pm

To All

Worked with Rao this afternoon ( a brilliant resource ) .. and there are several changes to consider when you create a .pdf in code .. I will try to List the "high points"

1) At the top of your Program you MUST insert REQUEST FWHARU
2) You need to add an variable at the top of your program to be able to save the file
Code: Select all  Expand view  RUN

Local lSaveHaru   := TPrinter():lUseHaruPDF
 


3) You define oPrint like this
Code: Select all  Expand view  RUN

PRINT oPrint FILE "c:\dbtmp\"+cPdfName+".pdf"   // location and name of your .pdf

oPrint:SetPage( 1 )
oPrint:SetPortrait()


4) You have to think in INCHES and not Pixels ... Rao did the calculation .. maybe he can chime in here for the SIZE conversion

Code: Select all  Expand view  RUN

// HEADING
   cHead1 := "State of South Carolina Department of Insurance"
   cHead2 := "Travel / Training Request Form"

   nRow  := 0.25 // inches
   @ nRow, 0.25 PRINT TO oPrint TEXT cHead1 + CRLF+ cHead2 SIZE 7.50,0.50 INCHES ;
      FONT oFont14b ALIGN "T"
   oPrint:Line( 0.8, 0.25, 0.8, 7.75, oPen1, "INCHES" )

 


Code: Select all  Expand view  RUN


Another Example
@ nRow, 6.45 PRINT TO oPrint TEXT "In State    (Y/N)" SIZE 1.3,0.6 INCHES FONT oFont10
// nRow is the same as the physical LINE where you want to insert your text

 


At the end of your code you need to issue these commands

Code: Select all  Expand view  RUN

ENDPAGE
ENDPRINT
// save the .pdf
TPrinter():lUseHaruPDF := lSaveHaru
 


This was not an easy exercise .. and would have been impossible with out Rao's Help and for that I give him a BIG Shout OUT for his tireless assistance and late hours ( in India )

Thank again Rao ..

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 97 guests