[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.axapta.programming

set DeviceName on printJobSettings object

Luegisdorf

2/1/2006 11:39:00 AM

Hi Everyone

I tried to set the deviceName on a printjobsettings object at runtime. I
used a deviceName which I get with the method getPrinter() before (like
'\\xxx\HP xxx'). Unfortunelly the deviceName is still the same like before
(default printer). Does I do anything wrong?

that's the sample code:

printJobSettings pjs = new PrintJobSettings();
int i;
;

for (i = 1; i <= pjs.getNumberOfClientPrinters(); i++)
{
info(pjs.deviceName(pjs.getPrinter(i));
// printer still has the old printerDevice
}

Thank you for your advices.

regards
Patrick
1 Answer

Luegisdorf

2/1/2006 11:47:00 AM

0

I've used a variable keep the printer name and this variable hasn't a valid
deviceName at that point where I'm reading it.

In other words: the example I've posted works!

Hope didn't blame you ;-)

"Luegisdorf" wrote:

> Hi Everyone
>
> I tried to set the deviceName on a printjobsettings object at runtime. I
> used a deviceName which I get with the method getPrinter() before (like
> '\\xxx\HP xxx'). Unfortunelly the deviceName is still the same like before
> (default printer). Does I do anything wrong?
>
> that's the sample code:
>
> printJobSettings pjs = new PrintJobSettings();
> int i;
> ;
>
> for (i = 1; i <= pjs.getNumberOfClientPrinters(); i++)
> {
> info(pjs.deviceName(pjs.getPrinter(i));
> // printer still has the old printerDevice
> }
>
> Thank you for your advices.
>
> regards
> Patrick