File Download Hangs
Posted on 2006-07-10
A very strange problem. The following code works everywhere except on client pc’s.
public void excelConvert(DataSet ds, HttpResponse response, string reportName)
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite);
DataGrid dg = new DataGrid();
dg.DataSource = ds.Tables;
dg.HeaderStyle.Font.Bold = true;
response.Charset = "";
response.ContentType = "application/vnd.ms-excel";
In our development environment (and most everywhere else) this code will cause the Open/Save/Cancel dialog to display. When you select Open, Excel is launched and the spreadsheet displayed. Selecting Save works as you would expect. In the production environment, Open/Save/Cancel dialog displays, you select Open and it hangs on File Download. And will stay there forever. Selecting save acts the same, hangs on File Download. The odd thing is that if you look in the Internet Temp Files directory on the failing client you will see that the .xls file requested is there, but Excel is never launched. I’ve been on the phone with Microsoft Support for 2 days and nothing. They were able to run my code fragment there with no problems. I have this code running on a number of tester systems and it runs fine. Simple question (hard answer) why does this rather straight forward piece of code not work on the clients PC?
One other hints: If I boot the failing client in Safe Mode it works fine.
It seems like some permissions/policy issue but I can’t figure it out.
Any ideas would be appreciated.