I am trying to print Excel(.xlsx) file via my web application by clicking a button. Everything works fine on my local, however when I upload to IIS, the moment I click the button. The page will just keep loading.
string destinationFileWord = filePath;
Process print = new Process();
print.StartInfo.FileName = destinationFileWord;
print.StartInfo.UseShellExecute = true;
print.StartInfo.CreateNoWindow = true;
print.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
print.StartInfo.Verb = "PrintTo";
print.StartInfo.Arguments = Utility.GetAppSettings("PrinterSettings", "Address1");
print.StartInfo.WorkingDirectory = Path.GetDirectoryName(destinationFileWord);
print.Start();
if (print.HasExited == false)
{
print.WaitForExit(5000);
}
Does anyone know what might be the problem?
Thank you.