Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 14th, 2004, 01:34 PM
Authorized User
 
Join Date: Dec 2004
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with an Excel file

I’m creating an Excel file (.xls) and showing it into a web page, I’m using this code:

Response.Clear();
Response.Buffer= true;
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "inline;filename=Clientes.xls");
Response.Charset = "";
this.EnableViewState = false;
System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
DataGrid1.RenderControl(oHtmlTextWriter);
Response.Write(oStringWriter.ToString());
Response.End();

When code finish it execution, a window is displayed, asking user if he want open or save the file, if he choose save, file is saved as Clientes.xls in folder user choose. But when user decide open file it is opened into a web form containing rows and columns as an excel file, if user modify some data and close web form, system tell user that this document have changed and ask if he wants to save it, if answer is yes, and an automated window is displayed containing file name (in blank) and type of save containing (web page), and user need to place file name and change type of save from web page to Microsoft Excel Book.
Does somebody know how to achieve this automated window be filled in file name with Clientes.xls and type of save be filled with Microsoft Excel Book?
I’ll appreciate your help.
A.L.


El Hombre que tiene Amigos ha de mostrarse Amigo
__________________
El Hombre que tiene Amigos ha de mostrarse Amigo
 
Old August 18th, 2006, 04:43 PM
Registered User
 
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to nzgara Send a message via Yahoo to nzgara
Default

We have this problem as well, if anyone knows how to fix it please post.

For now I know you must not use "open dialogue, you have to close the dialogue box, then go open the fie on the hard drive. then resave as excel book and remove the quotes, then it's truly an excel booklet, otherwise you get stuck with it as a web page.



Bradley P. Clark





Similar Threads
Thread Thread Starter Forum Replies Last Post
Create excel file without Excel being installed NoXuS C# 4 August 29th, 2009 12:38 PM
Problem in opening excel file in MS Excel 2000 kallol Visual C++ 0 November 16th, 2007 05:48 AM
Excel File Reader Problem umair.hasan ASP.NET 1.0 and 1.1 Professional 0 August 17th, 2007 11:12 AM
problem with excel file Adam H-W Excel VBA 0 April 11th, 2006 02:54 AM
Problem in Porting Data to Excel File ctranjith General .NET 0 August 1st, 2005 09:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.