Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

report to print in colors

Status
Not open for further replies.

PeriyurParthi

IS-IT--Management
Jul 18, 2001
258
IN
hi all
i have report which i use to display it in a screen. the following(prtc) variable stores all the details and useing @ say command i ll display the contents.
now what i need is for each field in below said, i have to diaplay it in different colors.

PRTC=ltrim(BK)+' '+ltrim(VHNO)+' '+ltrim(prtclr)
red blue green

wheather it is possible, if so how???, please help
replies will be helpful
thanks
parthi
 
Parthi,
You'll have to SAY each piece separately, since there is no way to change the color mid-string.

Rick
 
Hi there.

Are you definitely tied to using the @...SAY command?
I haven't got my manual handy but isn't there a clause for COLOR or RGB for the @...SAY command.

Anyways that is pretty old way of doing this you may wish to consider the methods below:

You could use a label or text box to display the information in chunks (one screen object for each component)

example:
BK is one form object with colour attribute set to red
VHNO is another form object with color attribute set to blue
PRTCLR is another with colour set to GREEN

OR

You can build the report in the VFP report generator which gives control of the report object's colours. Of course each component will have to be separated so the colour can be set at that level.

Have I confused you? Can I explain something more clearly? Let me know.

Petervfp
 
If you are indeed stuck with @...SAYS etc., here is another way (of course) to go about it using RGB():
F = Forcolor and B = backcolor
r = red, b = blue, g = green intensities.

RGB(Fr, Fg, Fb, Br, Bg, Bb)

@ x, y SAY ltrim(BK) COLOR RGB(255, 0, 0) &&... red
??' ' - VHNO COLOR RGB(0, 255, 0) &&... blue
??' ' - prtclr COLOR RGB(0, 0, 255) &&... green

'??' means print with no CR/LF and '-' works the same as LTRIM()

Dave S.
 
Let me retract my last post. You cannot use RGB() with '??'. Only with @..SAY's. So sorry. You would have to do an @..SAY whatever COLOR RGB(), then a SET COLOR TO before doing the ?? whatever:

@ x, y SAY ltrim(BK) COLOR RGB(255, 0, 0) &&... red
SET COLOR TO RGB(0, 255, 0) &&... blue
??' ' - VHNO
SET COLOR TO RGB(0, 0, 255) &&... green
??' ' - prtclr

Dave S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top