Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating and Opening an Excel file client side. 1

Status
Not open for further replies.

NatGreen

Programmer
Apr 19, 2002
90
US
Creating and Opening an Excel file, in a seperate window client side.

Any good examples/Articles out there?

I having trouble finding a good article/example on the best way to accomplish this task. All of my users do have Microsoft Excel on their machines.

Thanks for you help.
NatGreen
 
strName = "c:\whatever\myfile.xls";
Response.ContentType = "application/vnd.ms-excel";
Response.WriteFile(strName);
Response.Flush();
Response.Close();

the myfile.xls should exist. If you create it with nothing on it it would do the trick. I believe this is what you asked...

hth Daren J. Lahey
Just another computer guy...
If you are unsure of forum etiquette check here FAQ796-2540
 
You could probably do a <input type=&quot;file&quot;> control that intstead of sending the file just sends the name to strName. Course, I haven't worked with that control myself, but just a thought.
 
Actually I would like to export my data from a data grid to Excel. I do not want to create a physical file on the web server. Is there any way I could do a straight data dump to Excel?
 
What you are probably talking about is to &quot;dump&quot; the dataset into a stream object and send it to the Response object...
I'm not sure if that is possible though... Daren J. Lahey
Just another computer guy...
If you are unsure of forum etiquette check here FAQ796-2540
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top