Home : GSOpenPrn returned -1 occcured in Print Graph
Q10186 - ERRMSG: GSOpenPrn returned -1 occcured in Print Graph

When printing a graph, user receives an error message:

Error printername - GSOpenPrn returned -1

User gets no output.  There is a known 32-character printer name and path limitation with GSOpenPrn from Graphics Server (the OCX WIMS uses for graphing).

Solution 1: In version 7.2.2 and later, you may want to try Print Graph Method 1 for output of graphs.  See Print Graph Method General Setting

Solution 2: The user has to shorten the printer name.  Go to Control Panel, Printers and rename the printer. 

The following are the Tech Notes from Graphics Server:
Issue:
The call to GSOpenPrn("", "", style) is returning a failure (-1).
Short Answer:
There is a known 32-character printer name and path limitation with GSOpenPrn.
Discussion:
This is due to an internal usage of a 16-bit API that has a 32-character bottleneck at the printer name/path. You can check to see if this is the case by looking at your default printer and counting chars.

This failure usually only happens in networked printer environments, and in situations where names and paths are unnecessarily long.

Solutions? Not many. Aside form renaming the printer and possibly it's path/server, there are no alternatives while still sticking with GSOpenPrn and the GS printing APIs.

For Citrix/TerminalServices, see HOWTO: Shorten autogenerated printer names (that are too long) in Citrix / Terminal Services

 

Related Articles
Q11387 - HOWTO: Shorten autogenerated printer names (that are too long) in Citrix / Terminal Services

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
It seems to indicate that the 23-Character printer name is the problem, I have a printer named "Stylus C88" and at times I get the GSOpenPrn returned -1 error and other run time errors that crash the program. Since this is my only color printer, graph pac is made almost useless other than to display. Even when I do get the system to print a graph, then ther is usually another error when I try to do something like load another graph "OPS SQL Failed to retrieve List for egroupid=-1" Then OPS SQL crashs again. Approved: 7/30/2008 11:26 AM
Created on 10/4/2005 12:02 PM.
Last Modified on 12/13/2011 10:51 AM.
Last Modified by Scott Dorner.
Article has been viewed 10169 times.
Rated 6 out of 10 based on 8 votes.
Print Article
Email Article