PrintLog: How to - Windows Standard Printer?

Dear Members, I’m not sure I’m in the correct forum (maybe I should go to a .NET Dev Forum instead). Anyway… We are implementing Navision 4.0 SQL and would like to realize a printlog in Navision which covers all prints of documents with UserID, Printername, DocumentName, … Now the Printer is the hard thing to do as we don’t know which printer the user has chosen. As far as I know there is no possibility of getting information about the printer a report was printed to. If you know a trick for this (maybe a windows API-Call) please let me know. As this function is more or less for documents only I can look up via CU 1 the standard printer for a document. But if there is no entry in the printer selection table I would need to know the standard windows printer to write it to our log. Maybe there is also a windows API-Call to get the standard windows printer. Has anyone ever realized such a function? Any help is appreciated.

Does it need to be logged in Navision? Maybe Windows has a way to log print jobs. If so UserID and Printer(name) are likely to be included. Or use a commercial tool for it, a quick Google (windows print log) seems to indicate they exist.

@Peter: Yes, it has to be logged in Navision. The idea is to have a Log of printed documents (delivery notes, invoices, …) as a kind of proof that the document was actually printed. The Log will have entries per Document No. with information about the user, date, time, a status (print started, print finished), the printer it was printed to, the type as it was printed (Print,Fax,Pdf),… Navigate will also find these records. We can cover all of this. The only problem is the printer name. If the report was printed automatically a lookup in the printer setup will most probably give the correct printer, but if it was printed manually the user can choose another printer. Also there might not even be an entry in the printer selection table, then Navision would choose the standard windows printer. Outside of Navision you only have the user (the logged on user in windows) and the printer. That is not enough for this function.

And combining the two? If Windows can supply userid, printer and date / time you can use it to complete your record in Navision. I know, it’s a dirty solution but I can’t think of a Navision-only solution.

quote:

And combining the two? If Windows can supply userid, printer and date / time you can use it to complete your record in Navision

Exactly my thinking. But how do I get access from inside Navision to that information?

I don’t know that either.[:(] A quick search in knowledge base of Microsoft learned me that Windows does maintain a printer log. Just start from there and try to find out where and how it is stored. If you kinow that you can determine the best way to obtain the needed information. Good luck!

The solution would be to write your own custm printer driver. You could develop a driver that supports all your prointers, and have this driver determine which printer is used, and it would then be able to do the logging. A simple C/FRONT, or the other way and OCX can then pass the missing info. I think that there is a PDF driver built for navsion by an Add-On developer that can do some of this stuff, so maybe contact the company, and see if they can develop something or you. This is the company http://www.altusbusinesssolutions.com/ They seem to have a few neat tricks, and can maybe do what you need.