Sonntag, 27. Januar 2008

Check for a valid printer on the system

Today I've received an interesting problem with one of my applicatons. On a Win2003-Server the application should crash... I tried to reproduce it on my Win2003-System@home and no problem, the data (over dbx4) - connection and the preview or creation of pdf-files, created with Rave Reports (what else ), works on my system fine. On the WinXP on the customer-side it works, too.
The solution was easy, after I noticed that they haven't installed any printer-driver on the system:

include RpDevice in the uses and then you can check before the rave executes the existence of any printer:

if RpDev.InvalidPrinter then
showmessage('no printer'); -> and you should disable the execute of RvProject in the application

The older way with printers count can make trouble with network printers and isn't recommended (RPDev.Printers.Count).

After installation of a small printer driver (I prefer the HP LJ4 for things like this) the application creates reports with Rave on the customers server without any problems....

Keine Kommentare: