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

printing w/o report/label writer

Status
Not open for further replies.

dougerstew

Programmer
May 30, 2003
54
US
Hello,

I am printing 4 3.4x2 inch labels across a page. I am printing to an old mannesman tally T6092 and somehow my labels are getting out of alignment by using a foxpro label. The Tally tech suggested that I try to use "manual" commands to print it directly to a file and then print the file. I am having trouble figuring out how to do it. I will be wanting to print several hundred labels at a time in the following format (not to scale):

data1 data1 data1 data1
data2 data2 data2 data2
data3 data3 data3 data3
etc

Can someone give me some guidance on what "manual" foxpro commands to use to print either direct to a printer or to a file and then print the file to a printer?

Thanks,

Doug
 
The first question to ask is 'Why are the labels going out of alignment?" Is it a slow drift because Fox and the printer disagree about page lengths? Is it a fault with this old printer?

Try running some labels off from Word instead. If they drift too then it might be a printer problem. If they don't drift then one solution to your problem would be to put the source data into an xls and generate the labels as a MailMerge from Word.

Geoff Franklin
 
To answer your question about the manual print commands.

set device to print
Set printer on
?? "New LineData "
??? "Same Line Data"

( or )

@1,2 say "New Line Data" @1,15 "Same Line Data"

.......
Set Device to screen
set printer off


[Bold][italic]David W. Grewe[/Italic](Dave)[/bold]
 
Thanks for the input guys.
One question: how do I specify which printer to print to? I want it to go to a networked printer.
Thanks,

Doug
 
Geoff,

Thanks for the good question. In testing with the Tally Tech we determined that the printer works fine apart from Foxpro. It appears to be a problem with how the label writer interacts with the printer.
We have a label creating foxpro exe that used to be in unix but now is being used in Windows. The dbf's are the same but the code had to be changed slightly. We are also using the program to print to two newer Tally printers w/o any problems using the label writer.
I would like to print directly to the printer, but haven't found the correct commands to make it print to our specific network printer. I have been able to print to file (set device to file) and then send a dos command to send the job to a printer, but this also leaves the dos window open until the user closes it. Plus I'm also having some problem with the file location. Ultimately I'd like to have it print directly to our printer w/o using the label writer. But I am willing to have it print to file and then to the printer.
Thanks,
Doug
 
Gougerstew
I have been able to print to file (set device to file) and then send a dos command to send the job to a printer, but this also leaves the dos window open until the user closes it.

Use the syntax RUN CMD.EXE /C PRINT filename to terminate DOS session
 
Cricket,
Thanks for the idea. It works great if I do the "RUN CMD.EXE /C" by choosing Start/Run in windows. But if I issue the command in Foxpro, it still leaves the dos window open. I am actually issuing the command:
RUN cmd.exe /c lpr -S <ip address of printer> -P lpdprt1 filename.
Is there something different I should be doing?
Thanks,
Doug
 
Doug

Try inserting /n after the RUN command. It usually does the trick.

Cheers,
Roger
 
Thanks Roger.

Now that I've integrated the Run command in my application, I notice that the dos window does disappear, but just takes awhile (up to 2 or 3 minutes), depending on how long the print job is. On shorter jobs it goes away quickly(matter of seconds), but not on longer jobs.
Will the -n reduce the length of time the dos window appears, or is there another way to make it go away faster? I don't want my users to have to wait for it to go away before sending more print jobs. Would they be able to close the window manually w/o damaging the print job?
thanks,
Doug
 
Doug

You'll have to try it out. Usually the /n switch closes the DOS window immediately the external program is finished.

Roger
 
Sorry, I wasn't thinking before. /n is only if you are running a windows program.

If the external program is a DOS command, try ticking the 'close on exit' box under the program tab in foxrun.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top