print color fonts

Post Reply
jds
Posts: 106
Joined: Sat Dec 05, 2009 12:44 pm

print color fonts

Post by jds »

How can I, for example, in the following definition, incorporate the Color of a font (f.e. CLR_RED,...)
>DEFINE FONT oFont NAME 'ARIAL NARROW' SIZE 0,-9 OF oPrn
Thanks
José
ellano
Posts: 107
Joined: Tue Sep 15, 2009 7:52 am

Re: print color fonts

Post by ellano »

unless you want to do this afterwards:

Code: Select all

oReport:SAY(line, 5*nColumn,ALLTRIM(MyDB->MyField), oFont, ,CLR_HGREEN)
Emiliano Llano Díaz
jds
Posts: 106
Joined: Sat Dec 05, 2009 12:44 pm

Re: print color fonts

Post by jds »

Thank you Ellano, it works !!
jds
Posts: 106
Joined: Sat Dec 05, 2009 12:44 pm

Re: print color fonts

Post by jds »

Dear Ellano,
With your solution I can print fonts in any color but once I utilize a color font (for example in a do while not eof() ) the rest of records are printed in this color even if I program a condition (if else endif) to print some records of the do while in black color ?

Can you explain me what to do?

Thanks
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: print color fonts

Post by nageswaragunupudi »

Code: Select all

#include "fivewin.ch"

function Main()

   local oPrn, oFont, nRow
   local aColors := { CLR_HRED, CLR_GREEN, CLR_BLACK }

   USE STATES

   PRINT oPrn PREVIEW
   DEFINE FONT oFont NAME "VERDANA" SIZE 0,-20 BOLD OF oPrn
   PAGE

   nRow  := 2

   do while RECNO() <= 20 .and. !eof()

      @ nRow, 1 PRINT TO oPrn TEXT FIELD->NAME SIZE 5 INCHES ;
         FONT oFont COLOR aColors[ ( RECNO() % 3 ) + 1 ] ;
         LASTROW nRow

      SKIP
   enddo

   ENDPAGE
   ENDPRINT

   RELEASE FONT oFont

   CLOSE STATES

return nil
Image
Regards

G. N. Rao.
Hyderabad, India
jds
Posts: 106
Joined: Sat Dec 05, 2009 12:44 pm

Re: print color fonts

Post by jds »

Thank you very much to all of you, problem solved !
Kind regards
José
Post Reply