
Setting Default Printer in VB 5.0 for Crystal Reports 5.0 under NT 4.0
Les,
Please see my response interspersed below.
Quote:
> I guess you must have tried using the (infamous) VB printer object
> - bad enough under VB4, said to be impossibly buggy under VB5.
> No luck there??
Yes, I tried this first and then found a bug published in the KB.
I was able to direct my output to the printer I wanted, but
the setting of Printer.Orientation & .PaperSize was not
effective for the report.
Quote:
> An alternative (that I have not tried myself) would be to dig into
> the Windows API to control the printer (devmode structure and
> associated calls) - there is some freeware code floating around at
> some of the VB shareware sites to do this.
So far the only API I have found to use DEVMODE is a Crystal
PE API. Unfortunately, if I use that I will have to use PE API's
to do all the work of printing the report instead of using the
.OCX. I don't want to do that. :-)
Quote:
> What we have done, in the situation where there are only a small
> number of reports involved, is have separate .rpt files targeting
> specific printer bins/paper stocks/orientations. Not elegant, I
know.
I thought I remembered your posted this before. In this case
we could eventually have 30 to 50 (physical) printers defined
on the server, then multiplying that by the setups per printer,
we would have an enormous number of "printers" defined.
Thanks, though.
In the MS KB we found article Q105839 on setting the default
printer. However, it was written for VB3 and Windows versions
2.0 and 3.0. It uses WriteProfileString("windows","Device",
[then printername, driver and port]). I am willing to try that,
using SaveSetting instead of WriteProfileString,
but using Regedt32 and searching for keys, I cannot find
"windows","Device". In other words, I think the keys changed
for NT 4.0.
Marvin Bergeleen