Highlighted
Absent Member.
Absent Member.
2670 views

[archive] Printing Issues

[Migrated content. Thread originally posted on 19 September 2005]

Hi,

We have been having problems when trying to print from a AcuCobol application to a USB printer - does not matter which brand or model, and some other various printers. The print queue will display "sent to printer" but the document will not print. then if we try a second time the document prints.

We are just using the standard call for win$print. is there an issue with printing to usb printers, is there anything else we can do or try?

We are using version 5.2.1.1 of the runtime

Thanks

Kristopher Ellery
0 Likes
16 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Printing Issues

To my knowledge, there has never been an issue with USB printers. For a Windows application, whether a printer is an USB printer or not really doesnt matter because the application itself has no idea whether the printer is connected via USB, LPT, COM or even Ip or network. By saying application, this of course includes the ACUCOBOL-GT Windows runtime.

Your symptoms may rather indicate some other issues, is perhaps the printer a so called Windows printer, e.g. a decapitated printer which uses Windows GDI for all the processing, if so, how do you print to it? Via -Q or -P or as a device -D or LPT1 whatever?

As always, a little (as small as possible) code example that illustrates and reproduces your behavior is the best way to start.

A golden rule here is;

If your problem cannot reproduce in a 10 liner "hello world" style application, the problem is most likely in your code.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Printing Issues

Thanks for your reply, we use, -p spooler,

the code is simple, just the standard call

035100 CALL 'WIN$PRINTER' USING WINPRINT-SETUP GIVING PRINT-STATUS.
IF PRINT-STATUS
OPEN OUTPUT PRINTOUT.
IF VSACU-FILE-STATUS NOT = 00, GO TO EXIT-PROGRAM2.

It's strange, it happens to all usb printers, i wish i knew why, i have tried various settings in windows, but to no avail.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Printing Issues

Can you compile and execute this:


       program-id. prntest.

       file-control.
       select prnfile assign to "-P SPOOLER"
           organization is line sequential.

       file section.
       fd prnfile.
       01 prnline pic x(80).

       working-storage section.

       procedure division.
       main.
       call "win$prinnter" using 2.
           open output prnfile.
           write prnline from "hello world".
           close prnfile.
           stop run.



No compiler or runtime switches.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Printing Issues

Hi, thanks for that, i compiled and ran with no switches, and it printed first time with no problem to one of the printers we usually have an issue with, could this mean then, there may be an issue with my code, or a switch i may be using?

btw, this is what we use for printout.

fprintout.cop
005000 FD PRINTOUT.
005100 01 PRTREC PIC X(132).

printout.cop
003600 SELECT PRINTOUT
003600 ASSIGN TO PRINT ACU-F-PRINTOUT
LINE SEQUENTIAL
003600 FILE STATUS IS VSACU-FILE-STATUS.

Thanks in advance

Kristopher Ellery
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Printing Issues

It is most likely something with your code, configuration settings and/or compiler switches.

Which it is, is hard to tell without a complete reproducing example.

I suggest your only alternative is to take the reproduceable, remove thing step by step and see when the problem disappears.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Printing Issues

Cheers,

Very interesting why it seems to happen with my programs. I tried compiling one of our programs without any switches, ran it without any switches and then tried printing something, it still came up as "sent to printer" and did not print. the program that prints the customer docket is actually called by the initial program i run, so i thought, maybe it has something to do with that, however this morning i tried running a program that is not called by another tp print and same result "sent to printer" and nothing printed, even trying to restart the job does not help.

I just want to get this problem solved, as it is really starting to annoy me

Kristopher Ellery
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Printing Issues

ok, i am getting closer to finding out what the problem is exactly, when we changed from version 4 of the runtime to version 5, we noticed that winprint-setup when used came up with the page setup box rather than the printer selection box. Becuase all our users are used to the printer selection box, i modified the winprint.def file so that winprint-setup-old is used instead of winprint-setup. This has been working fine for us for ages, until trying to print to usb printers the first time and some other printers. so what i did with the hello world program was copy in the winprint.def file from the latest acucorp CD and then changed "using 2" to "using winprint-setup", the problem printer printed first time, like when "using 2", i then changed it to "using winprint-setup-old" then tried to print - it did not print. i know this is my problem.

We want to have the printer selection box shown, but winprint-setup-old causes problems with some printers, is there an op-code to use on winprint-setup to make it display the printer selection box rather than the page setup box?

Cheers,

Kristopher
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Printing Issues

Wow, really. So it turns out the good old WINPRINT-SETUP-OLD is not compatible with the USB printer? That must be a driver issue. There is nothing in the Microsoft SDK documentation concluding this is not supported (PrintDlg). Yes, it is superseeded by PrintDlgEx which we are planning on implementing, but nothing states it should not work.
So, short time solution is to check for driver updates.

As for the Page setup dlg that is suggested with the current WINPRINT-SETUP, I agree with you that it is a catch it does not provide a printer list directly, but it is in fact the recommended interface by Microsoft SDK.

If all you want really, is just a drop down listbox, I suggest you look in the sample directory for PrnDemoX.cbl and/or GraphPrn.cbl. Both these are examples of picking the printer in COBOL. I am quite confident you should be able to replace your call to WINPRINT-SETUP with a call to one of these, possibly also modifying them a bit to fit your needs.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Printing Issues

thanks again for your reply, only problem is a there is a vast majority of our customers that are using one of our programs that calls the winprint-setup-old, they have different printers, different makes and models of usb printers and we really can't tell them all to update their drivers.

Also the drivers that we are using are the latest, it is very strange indeed. in regards to using the prndemo as a start, i guess i will see what i can do, i am not an expert when it comes to programming so i will try my best at decifering the code and using some of it.

Thanks for all your help, you have helped me narrow down a problem which i assumed was with acucorp, but indeed is with my code, etc..
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Printing Issues

Just a pleasure, and btw, Happy Birthday!
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Printing Issues

cheers, thanks for that!
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.