From: Vaishali Kedar on
Hi,

I am using 27b and teh VO report editor.
I need to print to one of two printers on the network.

The report:print(oDevice) function asks for a device. Can someone please
tell me how to use the oDevice object?

Thanks,
Vaishali


From: richard.townsendrose on
Vaishali

I have in the shell window an export as follows:

EXPORT PrinterObject AS OBJECT // for ReportPro

and in the shell window init
SELF:PrinterObject := PtrDevice{SELF, SELF}

I also use
SysObject(SELF) // CAL 051001
so i can get the printer object ... anywhere.

but the code below should work as well ...

> > LOCAL oPtrDevice AS PtrDevice
> > oPtrDevice:=PtrDevice{oOwner,oOwner}

or use

oPtrDevice:=SysObject():PrinterObject

LOCAL cPrinter as STRING seems to be needed

> > cPrinter:=oPtrDevice:PrinterName
> > oPtrDevice:DefaultPaperSource == DMBIN_AUTO
> > oReport:PrinterDevice:SetPrinterByName(cPrinter)

regards

richard
From: Stephen Quinn on
Vaishali

> **The PrintingDevice class works to the extent that it will give me
> details of the default printer when used as PrintingDevice{}.
> Else, it asks to pass {uName} - what does it expect from me and does
> that enable me to send output to a printer other than the default printer
> (which is really the main object of this whole exercise).

You need to use the Registry to find out what other printers (ie names) are
defined on the machine in question and then pass the name of the required
printer to the PrintingDevice{} and then pass that printer object into the
Report object for it to use.

You cannot just pass any name into the printer object - it has to be one
that's installed on that machine.

IIRC you said your using the VO Report class, if so I don't know (never used
it) if you can do this with that class.

IIRC PrintingDevice{} or PtrDevice{} is part of Report Pro.

CYA
Steve


From: Geoff Schaller on
Steve,

You definitely would not use the registry. Too hard. Windows has nice
APIs for this kind of thing.

Geoff



"Stephen Quinn" <stevejqNO(a)bigpondSPAM.net.au> wrote in message
news:KE72o.1503$Yv.1307(a)viwinnwfe01.internal.bigpond.com:

> Vaishali
>
>
> > **The PrintingDevice class works to the extent that it will give me
> > details of the default printer when used as PrintingDevice{}.
> > Else, it asks to pass {uName} - what does it expect from me and does
> > that enable me to send output to a printer other than the default printer
> > (which is really the main object of this whole exercise).
>
>
> You need to use the Registry to find out what other printers (ie names) are
> defined on the machine in question and then pass the name of the required
> printer to the PrintingDevice{} and then pass that printer object into the
> Report object for it to use.
>
> You cannot just pass any name into the printer object - it has to be one
> that's installed on that machine.
>
> IIRC you said your using the VO Report class, if so I don't know (never used
> it) if you can do this with that class.
>
> IIRC PrintingDevice{} or PtrDevice{} is part of Report Pro.
>
> CYA
> Steve