Export to Excel 2007
I'm not a .Net developer but I'd guess your code creates a text file. Excel
2007 is equally capable of opening a text file as Excel 2003 so that
shouldn't be a problem. Even if your code creates an Excel 2003 files
(.XLS) Excel 2007 can open that too.
So I don't know what the problem is, but a clue would probably be found in
the exact text of the error message which you should have included in your
message.
--
Jim
"Amitabh" wrote in message
...
| Hi All,
| I have an web application where user can export the results of search
action
| to an excel file so he can locally store it.. I have done this with very
| simple code which is
| Response.ContentType = "application/vnd.ms-excel";
| Response.AppendHeader("content-disposition", "attachment;
| filename=StackRanking.xls");
| Response.Charset = "";
| System.IO.StringWriter sw = new System.IO.StringWriter();
| System.Web.UI.HtmlTextWriter hw = new
| System.Web.UI.HtmlTextWriter(sw);
| (........fils dataset..... hw.RenderBeginTag)
| (System.Web.UI.HtmlTextWriterTag.Html);
| dg.RenderControl(hw);
| hw.RenderEndTag();
| Response.Write(sw);
| Response.End();
|
| All work fine when end user has Excel 2003 but when he has Excel 2007 it
| gives a warning err message when he tries to open the rendered
(downloaded)
| Excel File,
| I guess i need framework 3.0 to Support the file format of Excel 2007.
What
| in the code needs to be changed to have compatibility with Excel 2007
| File.....
|
| Thanks for reading my query...
| --
| Software Engineer
|
|