Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Open the excel in new page while exporting

Reply
Thread Tools

Open the excel in new page while exporting

 
 
chandra82_tech@yahoo.com
Guest
Posts: n/a
 
      08-21-2006
Hi,

I have implemented export to excel functionality, which actually
exports the contents of HTML table to a excel sheet and asks for user
input on whether to open or save or cancel. The issue is when the user
clicks on "Open", the excel is opened in the same window where it is
being called or initiated, can i make it open in a new window?
Right now this how my code looks,
Context.Response.Clear();
//for displaying the open save dialogue box.
Context.Response.AddHeader("content-disposition",
"inline;filename=ExportContents");
Context.Response.Charset = "";
//set the target file type as excel.
Context.Response.ContentType = "application/vnd.ms-excel";

and i'm using a StringBuilder class to get all the information from my
HTML table and exporting to the excel by the following code,
//write to the excel sheet
Context.Response.Write(sb.ToString());
Context.Response.End();

-Chandra

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting to Excel using new version of Excel Doogie ASP .Net 1 11-19-2008 09:10 PM
change the sheet name while exporting datagrid data to excel =?Utf-8?B?U3JpZGhhcg==?= ASP .Net 0 11-09-2006 02:37 PM
exporting an excel file from database; making changes to excel file and updating the database by importing it back Luis Esteban Valencia ASP .Net 1 01-12-2005 12:28 AM
Urgent Pls!!!!! Problem while exporting data to excel sheet in asp =?Utf-8?B?U2lsZWVzaA==?= ASP .Net 1 11-08-2004 08:01 PM
Urgent!!!!! Problem while exporting data to excel sheet in ap.net =?Utf-8?B?U2lsZWVzaA==?= ASP .Net 4 11-05-2004 10:57 PM



Advertisments