Is this issue resolved?
Hi,
Hi,
Thanks for the information, I’ve tried using the updated version of Cells.
However, it works the same, pops up for saving the excel file correctly, but it doesn’t postback.
Would you have any work around to resolve this issue?
Thanks,
Hi Anna,
f_Message.Text = “OUTPUT READY…”; // <<<<<<<<<This change is not seen in page after postback<o:p></o:p>
<o:p> </o:p>
//Create a Stream object<o:p></o:p>
FileStream fstream = new FileStream(“D:\book1.xls”, FileMode.Open);<o:p></o:p>
<o:p> </o:p>
byte[] Data = new Byte[fstream.Length];<o:p></o:p>
<o:p> </o:p>
//Obtain bytes from streams.<o:p></o:p>
fstream.Read(Data, 0, Data.Length);<o:p></o:p>
<o:p> </o:p>
fstream.Close();<o:p></o:p>
<o:p> </o:p>
MemoryStream ms = new MemoryStream(Data);<o:p></o:p>
<o:p> </o:p>
// Sents the file to browser.<o:p></o:p>
Response.ContentType = “application/vnd.ms-excel”;<o:p></o:p>
<o:p> </o:p>
//Adds header.<o:p></o:p>
Response.AddHeader(“content-disposition”, “inline; filename=MyBook.xls”);<o:p></o:p>
<o:p> </o:p>
// Writes file content to the response stream.<o:p></o:p>
Response.BinaryWrite(ms.ToArray());<o:p></o:p>
<o:p> </o:p>
Response.End();
Hi Babar,
I found a workaround, and it works for my proejct.
What I wanted was after item (Export Excel) is selected, export or save data, then dropdown posts back.
I still don't understand what's going on behind the scenes, HttpResponse, and etc.
So what I did is simple, I do use the same code for generating excel, save workbook in the session and create a new page for this line of code "workbook.Save(...)".
I know there must be better solutions, for now I am good with this solution.
Thanks for your help!
Anna
Hi Anna,