Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > Green Screen
  New Posts New Posts RSS Feed - Local Printer
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum LockedLocal Printer

 Post Reply Post Reply
Author
Message
LenC View Drop Down
Newbie
Newbie


Joined: October 15 2004
Location: United States
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote LenC Quote  Post ReplyReply Direct Link To This Post Topic: Local Printer
    Posted: April 12 2005 at 2:12am
I would like to be able to print to the local client printer from a BASIC program without having to create a printer for each client on the host computer. Can this be done through Accuterm 2k2? The host is running Windows 2000 Server.

I assume this is a common issue, but I was not able to find a solution in the forum.

Thanks for your assistance.

Len Coolbeth
Len
Back to Top
homerlh View Drop Down
Beta Tester
Beta Tester


Joined: November 11 2004
Location: United States
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote homerlh Quote  Post ReplyReply Direct Link To This Post Posted: April 12 2005 at 3:01am
Len,

If I understand you properly, you want to print on the user's local Windows Printer using a PICK BASIC program.

I routinely do this by making use of the slave print capabilities of AccuTerm. I don't know what version of Multi-value you are using, but if it's D3, you can pretty much do this by simply assigning your printer properly.

Somewhere in the user's logon - or before you get ready to print to the local slave printer, you have to issue:

SP-ASSIGN AS

Which tells D3 that you are going to print using the slave printer and it also enables D3 to send the proper escape sequences for you. I'm assuming you have properly set up whatever AccuTerm terminal emulation you use with the tools available to D3. (Hope that made sense.) Using the SP-ASSIGN AS method, you don't have to worry about the program issuing the proper escape sequences within your program.

When you set up the printer in AccuTerm, you will note that there are two sections, one for SCREEN PRINT and one for SLAVE PRINT. You probably want the screen print to be graphics, but maybe not. I think you want the SLAVE PRINT to be set up to print raw data - text only. I found out the hard way by sending PCL through the slave port and if it's set in the wrong way, it comes out looking like PCL, not a pretty form.

Larry Hazel
Back to Top
LenC View Drop Down
Newbie
Newbie


Joined: October 15 2004
Location: United States
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote LenC Quote  Post ReplyReply Direct Link To This Post Posted: April 12 2005 at 6:37am
Thanks Larry!

We are using Universe release 9.6.2.1. I don't believe that Universe supports the SP-ASSIGN command for slave printers. I have not been able to find any documentation. Another complication is that we are running Accuterm in a Citrix environment. Citrix creates a client printer on the Citrix server when a session is started. This client printer is available to Accuterm.

We are experimenting with the terminal codes ESC[?5i and ESC[?4i for turning the transparent print mode on and off. This is working, but we are having trouble making sure that the output goes to the proper printer. It does not print to the printer named in the tools\settings\printer tab.

Any ideas would be greatly appreciated!

Thanks,

Len
Len
Back to Top
homerlh View Drop Down
Beta Tester
Beta Tester


Joined: November 11 2004
Location: United States
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote homerlh Quote  Post ReplyReply Direct Link To This Post Posted: April 12 2005 at 2:56pm
Len,

One of my clients has more than one facility. The remote facilities access the D3 server using a VPN over a DSL connection. All of the computers in one remote site have AccuTerm installed, and all have the same several printers defined under Windows - With the EXACT same name. Here's a list of the printers.

50,Epson LX-300
51,Epson Pick Labels
52,Epson Shipping Labels
53,Epson Packslip Printer
54,Epson Bill of Lading
55,Epson Invoice Printer
99,NOWHERE

The user has a menu system that lets the user assign a printer form number on which to print a given report - thus the 50, 51, etc. The names on the right are the EXACT windows computer names.

In the menu program, where we would be an SP-ASSIGN 50 since that is the printer number, we call this subroutine

SUBROUTINE ASSIGN.SLAVE( SPOOL.NO )
!
! PURPOSE : EXAMINES PARAMETER FOR CERTAIN VALUES AND
!        : ASSIGNES TO ASSIGNED PRINTER FOR ACCUTERM
!
EQU ESC TO CHAR(27), STX TO CHAR(2), CR TO CHAR(13), EM TO CHAR(25)
   !
   OPEN "SYSCON" TO F.SYSCON ELSE RETURN
   !
   READ I.SLAVE FROM F.SYSCON, "SLAVE.PRINTER" ELSE RETURN
   !
   N.LI = DCOUNT( I.SLAVE, @AM )        ;! how many printers ??
   !
   FOR LI = 1 TO N.LI
      ASSIGN.SPOOL.NO = FIELD( I.SLAVE<LI>, ",", 1 )
      ASSIGN.PRT.NAME = FIELD( I.SLAVE<LI>, ",", 2 )
      !
      IF ASSIGN.SPOOL.NO = SPOOL.NO THEN
        !
        SCR   =      &n bsp;    ; 'INITSESSION.PRINTERCLOSE'
        SCR = SCR : EM : 'INITSESSION.PRINTERNAME="' : ASSIGN.PRT.NAME : '"'
        CRT ESC : STX : 'P' : SCR : CR :
        SPOOL.NO = "AS"
        !
        RETURN
      END
   NEXT LI
   !
   RETURN
   !~~~~~
END

I hope it came through okay since I don't know how to post code to this forum. I'll check it and try again if not.

Anyway, the subroutine looks for a match on the form # - using a brute force method and then - thanks to PJS - it uses a brief script to change the active printer on the accuterm session.

It works like a champ. Perhaps you could modify it for your needs.

I did not figure out how to make the code look spiffy, sorry. So, if you want the code, email me at homerlh@cox.net and I'll send you the subroutine.

Larry Hazel
Back to Top
Deech View Drop Down
Moderator Group
Moderator Group

Moderator -- GUI Development

Joined: December 15 2003
Status: Offline
Points: 177
Post Options Post Options   Thanks (0) Thanks(0)   Quote Deech Quote  Post ReplyReply Direct Link To This Post Posted: April 12 2005 at 3:44pm
Larry,

At the bottom of the reply window there is link called forum codes. Click that link and a window will popup and show you all the codes available.

I took the liberty of fixing your previous post.

FYI,

Deech
Accuterm GUI--Changing the Face of MV Development!!
Back to Top
homerlh View Drop Down
Beta Tester
Beta Tester


Joined: November 11 2004
Location: United States
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote homerlh Quote  Post ReplyReply Direct Link To This Post Posted: April 12 2005 at 5:22pm
Deech,

WOW! That's Splendid.

Thank you.

Larry Hazel
Back to Top
LenC View Drop Down
Newbie
Newbie


Joined: October 15 2004
Location: United States
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote LenC Quote  Post ReplyReply Direct Link To This Post Posted: April 13 2005 at 7:07am
Thanks again Larry!

We have it working now. We used the following code:


SCRIPT = 'INITSESSION.PRINTERNAME=""'; * set to client default printer
SCRIPT = SCRIPT:CHAR(25):'INITSESSION.PRINTJOBEJECT = 2';   * force page eject
CRT ESC:CHAR(2):'P':SCRIPT:CHAR(13)

   CRT ESC:'[?5i';   * turn on slave printer
   CRT 'THIS IS A TEST OF THE EMERGENCY PRINTING SYSTEM'
   CRT ESC:'[?4i';   * turn off slave printer

   SCRIPT = 'INITSESSION.PRINTERCLOSE'
   CRT ESC:CHAR(2):'P':SCRIPT:CHAR(13)


When the printer name is null, it is set to the default client printer which works perfect for us.

Thanks again.

Len


Len
Back to Top
homerlh View Drop Down
Beta Tester
Beta Tester


Joined: November 11 2004
Location: United States
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote homerlh Quote  Post ReplyReply Direct Link To This Post Posted: April 13 2005 at 8:21am
Len,

My pleasure. I got the basic idea from Peter, so I'm very happy to share his knowledge.

Larry Hazel
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.