-
Print doesn't work
Hi All,
I have been handed a program written by someone else, that has been deployed and doesn't work correctly after deployment.
Basically we have a button with the following:
Code:
protected void btnPrint_Click(object sender, EventArgs e)
{
using (PrintDocument pd = new PrintDocument())
{
pd.PrintPage += new PrintPageEventHandler(printPage);
pd.Print();
}
}
in Dev the print button works everytime. I noticed that this references System.Drawing and that wasn't being deployed as part of the solution. I changed this so that this dll gets deployed as part of the solution into the bin folder for the app, however it has made no difference.
Anybody any ideas?
-
Re: Print doesn't work
Hello,
Just to confirm, are you expecting that this Print function will print to a printer that is connected to the client machine, or a printer that is connected to the server machine?
Gary
-
Re: Print doesn't work
It's a printer on the network. I thought it might be a permissions thing, but If the user presses the standard print button on the browser, then the page will print to the designated printer.
Even in the Dev environment where I can get it to print it's a network printer.
-
Re: Print doesn't work
It could still be permission based.
Does the identity that is running the Application Pool in IIS for your site, have access to, and can connect to the printer in question?
Gary
-
Re: Print doesn't work
After speaking with Ops, it appears that development are on network printers, but the users where the printers do not work are local. I'm wondering if they need to be opened up for sharing at a local level
-
Re: Print doesn't work
Ah, that could well be it, yes.
Gary