?
Solved

Send job to printer through web service vb.net

Posted on 2010-11-22
16
Medium Priority
?
1,439 Views
1 Endorsement
Last Modified: 2012-05-10
I try to print a report using a web service client I get this error:

"Settings to access printer '\\my-pc\Brother DCP-8025D USB' are not valid."

here's the code on the web service
Private Sub PrintLbl()
 Dim rep As New XtraReport1
        rep.Print("\\my-pc\Brother DCP-8025D USB")
End Sub

Open in new window

1
Comment
Question by:Mr_Ezi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 4
  • 4
16 Comments
 
LVL 3

Expert Comment

by:kolakanuru1
ID: 34192133
I guess the printer should have been installed on the server that is hosting this web service. If you are testing this app on you local machine, you should install the network printer as well on your machine.
0
 

Author Comment

by:Mr_Ezi
ID: 34192176
The printer works correctly on my machine. The error happens only when I try it from a different computer.
0
 
LVL 3

Expert Comment

by:kolakanuru1
ID: 34192317
As I said, the printer should have been installed on the machine where this web service is being hosted. Check that.
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:Mr_Ezi
ID: 34192375
Oh sorry I didn't got that, I can't install it there since its a Pocket-PC.
0
 
LVL 3

Expert Comment

by:kolakanuru1
ID: 34196400
I have no idea about the workings of pocket PC.

I would let other experts take on from here.
0
 

Author Comment

by:Mr_Ezi
ID: 34197354
Ok I tried with a local printer and it works great, how do I make a network printer working?
0
 
LVL 3

Accepted Solution

by:
kolakanuru1 earned 1000 total points
ID: 34200943
you need to install the drivers of the printer as well where ever this application is being hosted. I am sure you are hosting this on a server. setup the printer drivers on that machine You can cross check what printers are installed using

For Each printer As [String] In PrinterSettings.InstalledPrinters
Me.DropDownList1.Items.Add(printer.ToString())
Next

and then  your code would just work fine.

check the printers on the host, you should see some thing like

Brother DCP-8025D USB on my-pc     as one of the printers to print. where my-pc is the server name and the Brother DCP-8025D USB is the printer name
0
 

Author Comment

by:Mr_Ezi
ID: 34201124
Thanks.

I can't install the printer on the client since it’s a PocketPC, but I know that's not the issue because a local printer on the server will print correctly.

The problem is only with the printer that is not plugged in directly in the server, like a network printer.
So I know it’s a security issue.

I found a few sites talking about that but none of the solutions worked for me.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34204329
>I can't install the printer on the client since it’s a PocketPC,
He is talking about installing printer where the web service is HOSTED not where the webservice is accessed. Obviously its hosted on the server. Is the printer installed on the server? Also, does the account which is used to run webservice (network service or ASPNET etc) have permissions on the printer?
0
 

Author Comment

by:Mr_Ezi
ID: 34206329
Yes the printer driver is installed on the server, but it's not plogged in to the server, its connected to a other pc on the network.

as I said when I plug in the printer to the server t works great.

I'm not sure about the permissions how to set it to allow network printer's.

Thank for your help
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 1000 total points
ID: 34206456
When you share the printer on the computer where it is connected, you can set permissions on who is able to access it. Make it available to everyone.
0
 

Author Comment

by:Mr_Ezi
ID: 34207023
Oh ok let's try that...

where can I change that setting? I'm using Windows 7 on all pc's.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34207050
When you right click on printer and select Sharing, there is a Security tab on the resulting dialog box. Use that to set permissions. I am in a domain environment.
0
 

Author Closing Comment

by:Mr_Ezi
ID: 34208150
I tried so many thing's but finnaly it works.
Thank You
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34208180
So setting the permissions worked?
0
 

Author Comment

by:Mr_Ezi
ID: 34208256
Maybe I didn't try to remove it.... I don't know what did it in the end since I tried so many thing's.

The last thing I did was to change in IIS the credentials. see image.
 SampleThank again
0

Featured Post

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question