×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Print field in color in labels

Print field in color in labels

Print field in color in labels

(OP)
Hello colleagues!

I made a form in which the user will print some labels.
The user can choose the color of one of the field. The color od the field is defined as MyColor.
I need to print labels with the color the user chose:





Let's suppose the user chose the color RGB(184,20,0). The form the user selected his color, it was defined as:

CODE -->

MyColor="RGB('&UserColor')" 

How to tell the Label Designer the color it has to print? In "Field Properties", "Advanced"? If so, what to code?

Thank you,
SitesMasstec

RE: Print field in color in labels

I think for that you will need to have multiple labels with different colours and use the 'print when' to decide which is visible.

Or you could 'hack' the underlying label file (.lbx) and change the colour programmatically, there is a dynamics tab on a labels
properties you could perhaps use, but I suspect it would be as clumsy as my first suggestion.

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

RE: Print field in color in labels

It really depends how many possible colours you want to offer. If the user only chooses between, say, three different colours, you can go with Griff's suggestion. Create three identical fields, giving each one a different colour. Place them all in exactly the same place. Then, in the Print When box (Field Properties -> Print When), place an expression to determine whether that particular field will be visible (for example, MyField = RGB(255,255,0)).

But that would be impractical if you want to let the user choose from a large number of colours.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Print field in color in labels

Hi,

Suppose you have the scenario in which you present the user with a prompt to select the by the user wanted colour. Than save that colourvalue to a (public)report icolvalue.
Running your report you set the colourvalue of your label to the icolvalue.

I notice you are printing the washsymbols, is this a font or are you using picture values?

What is your OS(), your VFPversion and are you using FoxyPreviewer?

Regards,
Koen

RE: Print field in color in labels

Quote (Koen)

Running your report you set the colourvalue of your label to the icolvalue.

Yes, but the question is: How do you do that? A field in a report is not like a control on a form. It doesn't have properties that you can set programmatically.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Print field in color in labels

Koen, you asked about the wash symbols. There is something called an M54 font which includes these symbols. If you are googling for it, you might do better with "care symbols" rather than "wash symbols" as the search term.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Print field in color in labels

(OP)
Hello colleagues!

Before my post I had already used whar Griff and Mike has said (use 3 labels with different colors) to have work done. But I have more colors the user can choose... so I need to change the color of the first field programmatically.

Griff also said:

Quote:

Or you could 'hack' the underlying label file (.lbx) and change the colour programmatically, there is a dynamics tab on a labels
properties you could perhaps use
but I have never used dynamic tab, I will try.

Koen asked:

Quote:

I notice you are printing the washsymbols, is this a font or are you using picture values?
I am using a font. My VFP is version 9, running on Windows 10.
The first field of the label uses the font Harlow Solid Italic.

It seems, as Mike noted, the label cannot be changed programmatically, like a control in a form...

Thank you,
SitesMasstec

RE: Print field in color in labels

Mike,
you are ofcourse completely correct. Apparantly I was having a wrong spiral of thought. Mr. SitesMasstec, please forget about my remark.
Koen

RE: Print field in color in labels

If you're doing this with the Report Designer (rather than the Label Designer), take a look at the Dynamics tab of the Field dialog. You can set up rules to determine things about how the field prints. So if you can find a way to put the color information into your data, you should be able to do this.

Tamar

RE: Print field in color in labels

(OP)
Tamar:
I am using the Label Designer, It has a Dynamics tab, but I have never used it (by the way, I will have to learn about using it).

Thank you,
SitesMasstec

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close