Normal Topic Printing to a non-existent AlternateDefaultPrinter (Read 1170 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Printing to a non-existent AlternateDefaultPrinter
Aug 29th, 2007 at 3:03pm
Print Post Print Post  
Some of my users can print Invoices, some can print Workorders, and some can print both, all depending on whether I've installed the printer which is referred to as the AlternateDefaultPrinter() in the programming of the "Print" button on each form.

What happens to the PrintString output when a user without a referenced printer pushes the button?  Of course, there is no print output, and none of the installed printers show any activity.  Is the output just lost in the ether?  Is a file created on disk somewhere?

Can I create an @Error test to check for this, so I can alert the user with "You cannot print a Workorder from this workstation" message?  I tried putting such an @Error test after the first Printstring command, as so:
Code
Select All
// Selects the printer
// AlternateDefaultPrinter("Workorder")
AlternateDefaultPrinter("Test")

// Prints the Workorder number
Printstring(Workorder_Number, 430, vPosY + 5, 0, "BSanSerif", 22, 0)

// Alerts the user if the Workorder printer does not exist on his machine
IF @Error
THEN Writeln("Your workstation cannot print Workorders.") 


but the slate did not pop up. ("Test" is an imaginary printer.)

Any help will be, as always, greatly appreciated.
  

**
Captain Infinity
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printing to a non-existent AlternateDefaultPri
Reply #1 - Aug 29th, 2007 at 3:36pm
Print Post Print Post  
I wrote:
Quote:
What happens to the PrintString output when a user without a referenced printer pushes the button?  Of course, there is no print output, and none of the installed printers show any activity.  Is the output just lost in the ether?  Is a file created on disk somewhere?

I found out where it goes: there is a print output, and it goes to a another printer.  Nasty.  Any clues on how Sesame decides which printer in the list of installed printers to send the output to?

Looks like I'm going to have to install both printers on each machine.
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Printing to a non-existent AlternateDefaultPri
Reply #2 - Aug 29th, 2007 at 3:46pm
Print Post Print Post  
Infinity wrote on Aug 29th, 2007 at 3:36pm:
I found out where it goes: there is a print output, and it goes to a another printer.

I'd have to go read the source, but I strongly suspect that if the specified printer does not exist, it falls back to the system's default printer.

If you are using version 2, you can probably make use of the -user_param startup switch or USER PARAM INI file entry to specify which printers are available. See the @UserParameter command in the 2.0 Programming Guide for how to make use of these values.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printing to a non-existent AlternateDefaultPri
Reply #3 - Aug 29th, 2007 at 3:52pm
Print Post Print Post  
Quote:
I'd have to go read the source, but I strongly suspect that if the specified printer does not exist, it falls back to the system's default printer.

Actually, that's not what happened.  My default printer is an HP Laserjet.  The printers I use for Workorders and Invoices are Epson dot-matrix printers.  There are three of them. Instead of the dot-matrix that's usually used for Workorder printout, it went to one of the two I use for Invoices.

Quote:
If you are using version 2, you can probably make use of the -user_param startup switch or USER PARAM INI file entry to specify which printers are available. See the @UserParameter command in the 2.0 Programming Guide for how to make use of these values.


Thanks, I'll look into it.  But I'm not really concerned; installing printers is easy, and it's probably a good idea to give everyone access to the resources.  (Plus, each workstation's startup switch is set to 1 of 2 shared .ini files, depending on what size monitor they use.)
  

**
Captain Infinity
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Printing to a non-existent AlternateDefaultPri
Reply #4 - Aug 29th, 2007 at 4:11pm
Print Post Print Post  
Infinity wrote on Aug 29th, 2007 at 3:52pm:
Actually, that's not what happened.  My default printer is an HP Laserjet.  The printers I use for Workorders and Invoices are Epson dot-matrix printers.  There are three of them. Instead of the dot-matrix that's usually used for Workorder printout, it went to one of the two I use for Invoices.


Do they have the same names by any chance?

If the Alternate Printer does not exist by that name nothing will be printed. @Error will be set when FinishPage() is called as that is when the output is sent to the printer.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printing to a non-existent AlternateDefaultPri
Reply #5 - Aug 29th, 2007 at 8:33pm
Print Post Print Post  
Quote:
Do they have the same names by any chance?

Nope.  There's "Workorder", "Sherman", and "\\MIARA-2000serve\Invoice".

A test print of a Workorder to AlternateDefaultPrinter("Test")  (which does not exist) arrived at "Sherman" (an invoice printer, but still an Epson LQ-590 dot matrix like the other two).

Quote:
If the Alternate Printer does not exist by that name nothing will be printed. @Error will be set when FinishPage() is called as that is when the output is sent to the printer. 

OK, this sounds good, so maybe what I experienced was a fluke.  I'll toss an @error test after FinishPage() and see what happens.  Thanks Ray!
  

**
Captain Infinity
Back to top
IP Logged