Printing to a network printer from windows 2003 server fails...

Printing to a network printer from windows 2003 server fails...

am 28.01.2008 14:51:01 von SaiVajja

Hi

I have a problem printing to a network printer from my VB.NET code component.
When i try printing to the network printer from my development PC all works
fine..
But, when i publish the code to the server and try the print, i get the
following message....

Settings to access printer '\\ServerName\MyNetworkPrinterName' are not valid.

When i try to change the spooler name to its IP, i still get the same error
message...

Settings to access printer '\\xx.xx.xx.xx\MyNetworkPrinterName' are not valid.



Here is a glimpse of the code behind the print...
m_DocumentPath = m_DocumentLocation & m_DocumentName

With m_pd
.PrinterSettings.PrinterName = m_PrinterName
.PrinterSettings.Copies = m_Copies
'.PrinterSettings.
AddHandler m_pd.PrintPage, New
System.Drawing.Printing.PrintPageEventHandler(AddressOf PrintImage)
m_pd.Print()
End With

Re: Printing to a network printer from windows 2003 server fails...

am 28.01.2008 15:30:48 von Norman Yuan

What kind of application do you run in the server? A Win form app, Windows
service, or web application? It is possible the user account used to run the
application does not have access to the network resource (printer),
especially if it is a web app. If you absolutely need to print at server
side, you need to make sure the application runs under a user account that
has to permission to needed network resources.


"Sai Vajja" wrote in message
news:7A001297-89D8-485D-AB41-1C409461BC21@microsoft.com...
> Hi
>
> I have a problem printing to a network printer from my VB.NET code
> component.
> When i try printing to the network printer from my development PC all
> works
> fine..
> But, when i publish the code to the server and try the print, i get the
> following message....
>
> Settings to access printer '\\ServerName\MyNetworkPrinterName' are not
> valid.
>
> When i try to change the spooler name to its IP, i still get the same
> error
> message...
>
> Settings to access printer '\\xx.xx.xx.xx\MyNetworkPrinterName' are not
> valid.
>
>
>
> Here is a glimpse of the code behind the print...
> m_DocumentPath = m_DocumentLocation & m_DocumentName
>
> With m_pd
> .PrinterSettings.PrinterName = m_PrinterName
> .PrinterSettings.Copies = m_Copies
> '.PrinterSettings.
> AddHandler m_pd.PrintPage, New
> System.Drawing.Printing.PrintPageEventHandler(AddressOf PrintImage)
> m_pd.Print()
> End With
>
>

Re: Printing to a network printer from windows 2003 server fails..

am 28.01.2008 15:47:01 von SaiVajja

Hi Norman

Sorry for not being very clear in my earlier post...
Here is the actual situation..

This is a ment to be a server based application and will be running as a
windows service.

It's purpose is basically to seperate out bulk printing and emailing from my
website.

I did get this doubt myself about user account and have tried to run the
service under various accounts (including an admin account..) but i still get
this same error.

I even tried all comnbinations of the \\server\printername with both ip
addresses and names.

The IT support guys here at my work said it could be something to do with
the printer drivers but i doubt that (what do you think?).

The service works fine when i test it from my development PC which is xp
professional. The server which will eventually host this app. is windows 2003
server...



"Norman Yuan" wrote:

> What kind of application do you run in the server? A Win form app, Windows
> service, or web application? It is possible the user account used to run the
> application does not have access to the network resource (printer),
> especially if it is a web app. If you absolutely need to print at server
> side, you need to make sure the application runs under a user account that
> has to permission to needed network resources.
>
>
> "Sai Vajja" wrote in message
> news:7A001297-89D8-485D-AB41-1C409461BC21@microsoft.com...
> > Hi
> >
> > I have a problem printing to a network printer from my VB.NET code
> > component.
> > When i try printing to the network printer from my development PC all
> > works
> > fine..
> > But, when i publish the code to the server and try the print, i get the
> > following message....
> >
> > Settings to access printer '\\ServerName\MyNetworkPrinterName' are not
> > valid.
> >
> > When i try to change the spooler name to its IP, i still get the same
> > error
> > message...
> >
> > Settings to access printer '\\xx.xx.xx.xx\MyNetworkPrinterName' are not
> > valid.
> >
> >
> >
> > Here is a glimpse of the code behind the print...
> > m_DocumentPath = m_DocumentLocation & m_DocumentName
> >
> > With m_pd
> > .PrinterSettings.PrinterName = m_PrinterName
> > .PrinterSettings.Copies = m_Copies
> > '.PrinterSettings.
> > AddHandler m_pd.PrintPage, New
> > System.Drawing.Printing.PrintPageEventHandler(AddressOf PrintImage)
> > m_pd.Print()
> > End With
> >
> >
>
>