I'm not certain I understand what you mean by "desired results are not achived". Are you trying the use the HP command codes from Solaris, or are you trying to get printing working using CUPS?
If the latter, as root point a browser at
http://localhost:631 to get into CUPS administration. Once there, configure your printer.
Note that you may configure several virtual printers even if there is only one physical printer. Each virtual printer can be configured for a particular print task, such as landscape vs protrait; greyscale vs color; draft vs normal vs photo or letter quality. The advantage is that less time is spent in the printer setup dialogue each time you want to print something. If you do little printing, you don't save much time. If you do a lot of printing, your time saved by not having to configure the print each time you have a job to print adds up.