Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Printing Directly To A Printer VIA Foxpro

Posted on 2011-09-16
6
Medium Priority
?
2,938 Views
Last Modified: 2012-06-27
hi all,

i was hoping someone could help me.

we are currently trying to move towards using device fonts on our label printers (Zebra Z4Ms)

i can write a script for output no problem in notepad however when i try to implement it into foxpro it does not function!

i dont know where i am going wrong, if i am calling parameters wrong etc.

if you look at code8207450 you can see the foxpro version and if you look at the 8207451 you can see what i have tested with using notepad.

thanks,

Arran


CLEAR
CLEAR ALL
SET TALK OFF
SET EXACT on

set printer to  name getprinter()
set printer on 
 
USE m:\global\accounts\globalnew IN 0 shared 
select globalnew
GO 136570 

DO WHILE recno()<=136585

SET SAFETY off
copy next 1 to c:\global\hawbb
 
use c:\global\hawbb in 0 exclusive

alter table hawbb add column deldock c(30) 
select hawbb
picad=""
store str(docket_no) to wub
store str(pieces,3) to boc
boc=strtran(boc," ","0")
wub=alltrim(wub)
picad=strtran(picad," ","0")
deldo="FR"
replace deldock with "*"+wub+"-"+picAD+boc+"-"+deldo+"*" 
 
set safety on
******
???
^xa
^lh30,80
^FO20,10^AS,90,90^FD HAWB:+str(docket_no,7)^FS
^FO20,110^AS,35^FD Upper(trim(company))^FS
^FO20,160^AS,35^FD upper(trim(address1))^FS
^FO20,210^AS,35^FD upper(trim(address2))^FS
^FO20,260^AS,35^FD upper(trim(address3))^FS
^FO20,400^AS,35^FD "Contact "+upper(trim(contact))^FS
^FO20,480^AS,90,90^FD1 OF 1^FS
^FO120,650^BC,60^FD upper(deldock)^FS
^XZ


eject page 
****** 
SELECT hawbb
use
SELECT globalnew
 
SKIP
enddo

Open in new window

^xa
^lh30,80
^FO20,10^AS,90,90^FDHAWB:   6627281^FS
^FO20,110^AS,35^FDMCR PRINT^FS
^FO20,160^AS,35^FD11 ENGLISH BUSINESS PARK^FS
^FO20,210^AS,35^FDENGLISH CLOSE^FS
^FO20,260^AS,35^FDHOVE EAST SUSSEX BN3 7ET^FS
^FO20,400^AS,35^FDCONTACT: VICKY DAY^FS
^FO20,480^AS,90,90^FD1 OF 1^FS
^FO120,650^BC,60^FD*6627281-001001-SRA*^FS
^XZ

Open in new window

0
Comment
Question by:gaa18
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 43

Expert Comment

by:pcelba
ID: 36548241
I don't know what you mean by code8207450 but the ??? command requires a character string as a parameter, so you should provide better format of your commands (or better format of your question).

0
 

Author Comment

by:gaa18
ID: 36548284
i was talking about the code snippits.

i dont know what you mean by better format of codes? im just trying to run ZPL code within foxpro?
0
 
LVL 12

Expert Comment

by:jrbbldr
ID: 36548802
The following is NOT a Foxpro/Visual Foxpro command:
   ^FO20,400^AS,35^FD "Contact "+upper(trim(contact))^FS

And without quotes around it, it is not 'seen' in FP/VFP as a character string.

If that is a printer 'command' string, and you want to send it to a printer, then you need to first handle it in FP/VFP accordingly.

How you handle the Command String may depend on if you are using a FP/VFP Report Form or not.

Let us know and we'll try to help.

Good Luck
0
Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

 

Accepted Solution

by:
gaa18 earned 0 total points
ID: 36549186
its ok i sussed it! was my error..... as i thought....

this did the trick:


CLEAR ALL
USE m:\global\accounts\globalnew IN 0 SHARED
SELECT globalnew

SET PRINTER on
SET PRINTER TO \\printscanserver\ZebraGen
GO 136580
DO WHILE RECNO()<136590



??? '^xa'
??? '^lh30,80'
??? '^FO20,10^AS,90,90^FDHAWB: '
? docket_no
??? '^FS'
??? '^FO20,110^AS,35^FD'
? space(5)+ Upper(trim(company))
??? '^FS'
??? '^FO20,160^AS,35^FD'
?  space(5)+upper(trim(address1))
??? '^FS'
??? '^FO20,210^AS,35^FD'
?   space(5)+upper(trim(address2))
??? '^FS'
??? '^FO20,260^AS,35^FD'
?   space(5)+upper(trim(address3))
??? '^FS'
??? '^FO20,310^AS,35^FD'
?  space(5)+upper(trim(address4))
??? '^FS'
??? '^FO20,400^AS,35^FDCONTACT: '
?  space(5)+upper(trim(CONTACT))
???'^FS'
??? '^FO20,480^AS,90,90^FD'
?   space(5)+str(GLOBALNEW.PIECES,4)+" of "+str(globalnew.pieces,4)
??? '^FS'
??? '^FO120,650^BC,60^FD'
if upper(trim(globalnew.country))="ITALY" OR upper(trim(globalnew.country))="SWITZERLAND";
OR upper(trim(globalnew.country))="BELGIUM" OR upper(LEFT(globalnew.country,3))="LUX"
?? space(5)+"*"+alltrim(str(globalnew.docket_no))+"*"
endif 
? DOCKET_NO
??? '^FS'
??? '^XZ'
SKIP
enddo

SET PRINTER off
SET PRINTER TO default

Open in new window

0
 
LVL 43

Expert Comment

by:pcelba
ID: 36551748
Yes, the ??? commands have string parameters now. And it must work.
0
 

Author Closing Comment

by:gaa18
ID: 36898831
worked it out myself
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question