Export Excel (in a new window) not opening without pressing CTRL key !!
-
Hello In my web application, I made a excel export of my screen (a simple informations grid !) and i tried to open that excel export on a new window (to not overwrite my browser content) and i used this instruction :
this.Page.RegisterClientScriptBlock("xlExport",@"javascript: window.open('/MyApplication/DefaultController.aspx?PageId=ExportXLPage&xlFiles=" + fileName + "','NewWnd','resizable=1,toolbar=1,location=1,status=1,menubar=1,scrollbars=1');");
to inject this code dynamically into my asp page, so that this code will be executed and the page "ExportXLPage" will be opened. And in that destination page i putted this intsruction,Response.Redirect(FileName));
to display the excel file wich i made with these headers (just to mention) :string str = "charset=utf-8"; oStringBuilder.Append("");
That worked fine on some machines and didnt on other ! In fact the new window opened and quickly closed whithout displaying anything on a machine with XP system and IE 6, and worked fine on , for example, a machine with WIN2000 and IE 6. Even worst : when i pressed CTRL key and request that export, it worked and the new window was perfectly displayed with the usual options (save/open/cancel) of the excel file. And i have to mention that i already desactivated the POPUP blocking system of my internet explorer !! (that could be normally desactivated with hitting CTRL key). Could that be related to the server's configuration (i mean system version...), or the client's configuration or may be both of them ?!?! Or did i simply wrongly opened that new window or badly built my excel file ? (All these problems occured when my application was published on my client server, but when i tested on my local machine, every thing was alright !!) Thanks in advance for helping soon