Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Getting Report.SelectPrinter method to work.

I am using VB 6.0 and CR 8.5 (via the CRAXDRT library -upgrading is not an option at this time).

This code

Report.SelectPrinter "winspool", strPrinter, "Ne00:"

does not work if the program is executed via Windows Scheduled Tasks. It works fine when users run the program interactively. No error is generated, the report just won't print. The strPrinter variable contains a valid network printer name, eg "
srvprxxxx\pr3456789"

Any hints/things to try to getting SelectPrinter to work when the app is running as a Scheduled Tasks would really help.

Here is what I have already tried.

Use the CRPEAuto library instead. Guess what, everything works fine. I would switch to the CRPEAuto library but unfortunately it does not support report parameters with multiple values. There is no CRPEAuto.ParameterFieldDefinition.AddCurrentValue method like there is in CRAXDRT.

If you know of a way to pass a report parameter multiple values using the CRPEAuto library I would be grateful.

I also used the API functions in the crpe32.dll directly. Again, my small test application worked fine but unfortunately this API is not an option because I would lose existing functionality of our in-house dlls already in production.

Is it possible to get the "PrintJob #" (required by the CRPE32 API functions) from the CRAXDRT Report object?

I seem to be in a catch-22 situation. No matter which library/method I try to utilize it fails at some point.

Not what you were looking for? View more on this topic or Ask a question