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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PRINTING TO DIFFERENT PRINTERS

Status
Not open for further replies.

rajeevnandanmishra

Programmer
Jun 1, 2001
379
IN
Hi all,
I am here again. May be with a sily question. :)

From our project we can do two type of printing.
1. Normal ----> Which goes directly to the default printer.
2. Label ----> Which should go the Label Printer.

So, i have not written anything for the normal printing.
But for the forms where i am printing labels, i have following code.
**************************************
SET CONSOLE OFF
SET DEVICE TO PRINTER
SET PRINTER ON
* mPrinter can have one of two values
* 1. 'LABELPRINTER' 2. '\\PrintServer\LABELPRINTER'
* Means it can be a local or network printer
SET PRINTER TO NAME &mPrinter
*<---
*
* Here is my code for printing having some ? statements
*
*-->
SET DEVICE TO SCREEN
SET CONSOLE ON
SET PRINTER OFF
SET PRINTER TO
**************************************

Now the problem is, when i try to print a label, first time, it prints a blank page to Default printer also and in later print outs it print only to the labelprinter.
But after this when i try to print Normal reports, they are not printing on the default printer. In this case the light on the labelprinter is blinking, but no print.


No need say, Any help (urgent :) ) is highly appreciated.


Raj
 
Hello Raj,

I don't know, but perhaps the SET commands need reordering?

If you set the printer to something, then that's where everything that you print from your application will go until you change it to something else.

You should change it back to the default after printing the labels.

Have you thought of using VFP's report & label generators? They do work quite well.

Hope that helps,

Stewart
 
Hello Stewart,

Thanks for your comments.

It is a good thing to change the order of SET commands. But to what? I must have done this in the age of 2.5/2.6. But now i don't remember, what i would have done!

I can not use VFP's report/ label generators. As these labels are specific and used for Bar code printing also. So, from the program we are sending some printer specific codes to print the labels in a particular way.


Raj
 
HI

**************************************
SET CONSOLE OFF
SET DEVICE TO PRINTER
SET PRINTER TO NAME &mPrinter
*
* Print routines/code/statements
*
*-->
SET PRINTER TO && This is not required if next line is put
SET DEVICE TO SCREEN
SET CONSOLE ON
**************************************

Hope this order helps you out. Depending on your print statements, some times.. there is no need to explicitly do the code.. SET PRINTER ON.. since this could send a blank page feed.
Output formatted with @ ... SAY isn't routed to the printer when SET PRINTER is set to ON. Instead SET PRINTER TO NAME .. will take care of that.

Hope this helps you :) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Hi Ramani,

Ok! I have tried this sequence now.
************************************************
SET CONSOLE OFF
SET DEVICE TO PRINTER
SET PRINTER TO NAME &mPrinter &&LABELPRINTER
SET PRINTER ON
?&quot;{XR;0995,0027,1000,0720,B|}&quot;
?&quot;{PC000;0949,0048,10,10,D,11,B|}&quot;
?&quot;{RC00;PART No.|}&quot;
?&quot;{PC001;0825,0048,10,10,D,11,B|}&quot;
* a few more lines with ? command
SET PRINTER OFF
SET PRINTER TO
SET CONSOLE ON
SET DEVICE TO SCREEN
****************************************

Now let me explain a few more things.
With this code :
1) if we print different reports (normal/ label) from the machine where labelprinter is installed remotely, it works fine.

2) On the machine where we have installed LabelPrinter, we have another Normal printer also installed locally. And when we print the Labels, it prints the label on LabelPrinter and a blank page on the Normal printer. For any subsequent Normal reports, it tries to print on LabelPrinter (the light was blinking), but does not print anywhere.

Moreover, all this information i am giving regarding WINNT everywhere. I have not checked any of these under WIN9X OS.

I think this is all i know about this.

PS:1) Ramani, I was remembering something about fpd2.6 days when i used to set printer first to temporary file and then to actual file or something like that. Do you think, i have to go through those things ( i am afraid, i don't remember it currently).
2) I had dropped a mail at your yahoo address. :)


Rajeev
 
HI Rajeev,
************************************************
SET CONSOLE OFF
SET DEVICE TO PRINTER
SET PRINTER TO NAME &mPrinter &&LABELPRINTER
??&quot;{XR;0995,0027,1000,0720,B|}&quot;
??&quot;{PC000;0949,0048,10,10,D,11,B|}&quot;
??&quot;{RC00;PART No.|}&quot;
??&quot;{PC001;0825,0048,10,10,D,11,B|}&quot;
* a few more lines with ? command
SET PRINTER TO
SET CONSOLE ON
SET DEVICE TO SCREEN
****************************************

I have removed SET PRINTER ON. I think you missed this part in my previous answer. SET PRINTER ON/OFF will send the blank page.
Try the above way and see if this helps :)

Regarding your email, the reply is on the way or already at your box. :)
Have a nice day :) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Hello Ramani,

Unfortunately, ?/?? is not working,
if i am not giving the command SET PRINTER ON

Do i have to give some special command to print the results on printer using ?/??

Raj
 
I use the aprinter() function to determine which printers are available to me. When I find the one I want I put in code to change it for instance:

aprinters(aprinter)
if ascan(aprinter,&quot;BroadGun pdfMachine&quot;) > 0
set printer to name &quot;BroadGun pdfMachine&quot;
endif

Then when i am finished with the report

set printer to
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top