The big mistake people make in this situation is saying "NO". (Remember a dog jumps up on you because he thinks you are great, wants attention, etc. When you say "NO" he can't understand the problem, and tries all the harder, i.e. jumps up higher.)
What you do is to make a fuss over him/her, pet him, tell him what a wonderful person he is, but at the SAME TIME step on his toes, knee him in the chest, whatever. He will notice this only as an inconvenience, and almost immediately will stop doing what annoys him, because at the same time he is loving the attention you are continuing to give him.
This will cure the jumper in nothing flat.
(It also cures any dog with the habit of pawing you to get your attention when you are sitting down. Just hold the blade of a regular dinner knife, for instance, in your hand without making it obvious, and when the dog comes to paw you, snap the handle across the top of his paw AT THE SAME TIME you are giving him congratulations, making a fuss over him, petting him, etc. As above, he will immediately recognize it is annoying to him, and quit, while glorying in the attention he is receiving.)
In both cases above, what you are doing is, in effect, saying "I love you, BUT, just as you would to a child who came to greet you, but stood on your foot.....