export to excel without page content?


I am trying to save an excel sheet on the client machine . When I open this sheet using a notepad , then the xml also has the page content .

I donot want this to be saved . 

How would I get this ?

XmlSerializer ser = new XmlSerializer(typeof( <my XMLObject class>));

XmlTextWriter xml= new  XmlTextWriter(Page.Response.Output);

Response.ClearContent(); Response.Clear(); Response.ClearHeaders();

Response.Output.Flush();

xml.Serialize(xml, ser);

Response.AddHeader(
"Content-Type", "application/vnd.ms-excel");

Response.AddHeader("Content-disposition", "inline; filename=DataSave.xls");

 

After I save, the excel spreadsheet appears fine but when I open the spreadsheet using an editor,

 remaining part of  page content [like labels and buttons] is also  stored in DataSave.xls .

Thanks

 

0
Geta
7/4/2007 3:47:44 PM
asp.net.web-forms 93655 articles. 4 followers. Follow

2 Replies
410 Views

Similar Articles

[PageSpeed] 12

Just try to put Response.End() at the end


Never ask users what they want, or they'll tell you
0
ArtemL
7/4/2007 4:58:11 PM

Just figured.

thanks

0
Geta
7/4/2007 5:03:37 PM
Reply:

Similar Artilces:

Export web form contents to Excel?
Is there much to exporting the contents of a web form to an Excel spreadsheet?  I've been doing some research and the vast majority of articles seem to pertain to exporting GridView and DataGrid controls.Thanks!  RobertF57:Is there much to exporting the contents of a web form to an Excel spreadsheet?  I've been doing some research and the vast majority of articles seem to pertain to exporting GridView and DataGrid controls.  Base on my experience, you can create Excel.Application to solve your problem, check out the following link: http://support.microsoft.c...

Can my web page with a form submit to other web pages forms?
I was wondering if I created an aspx page that had a form on it that I could use the submit button to submit this form's contents to other web pages forms(servers accepting those form's data). I am thinking this would be a great way to update data on particular web pages without having to actually visit those similar web pages. Any ideas, examples would be much appreciated. Thanks in advance.  Yes you can.  It's called Cross Page Posting: http://msdn2.microsoft.com/en-us/library/ms178139.aspxAlso: http://msdn2.microsoft.com/en-us/library/ms178140.aspx might ...

How do you incorporate a web page in a web form without IFrame
I would like to display a web page in my web form, but don't want to use frames or I frames. Can it be done with a label? If not then any suggestions and code would be appreciated. Thanks Please describe in more detail what you are trying to achieve. Frames and IFrames are for the purpose of rendering >1 html page in a single browser window. AFAIK there is no other way to achieve this purpose, but maybe you are trying to describe a different purpose? Basically it's a search page. The search term is picked up from a text box and then a URL is called. The URL is fed with the s...

Aspose.Excel.Web 1.0 Released!
Aspose.Excel.Web 1.0 Released! Version 1.0 Released on March 10 2005 ...

How to pass the form contents of aspx page in .Net to Jsp page
Hi,   I want to pass the login information from aspx page to jsp page. plz help me how to do it. Please reply asap. Thanks...

Web Form vs. Web Content Form
If you don't mind, I would like to know what is the difference between those two items, when I go to add a new item I see both of those and I don't know what the difference is.  A content form is for use with a masterpage. A web form is a standalone web page. If you select web content form, you will then have to specify a masterpage for it. and what is a master page used for?  Hi, a master page is used to give a constant look and theme to a site, without having to duplicate code. So basically you can put your header, menu, nav and footer on a master page. Then a...

change save as type from web page to excel for gridview exported to excel
Hi Everyone, I have a website set up with a button that exports gridviews on the pages to excel.  That works fine.  The users now have asked that when they then in excel go to save the excel (after viewing it), that the save as dialog box automatically uses the excel format, not web page format, and that is automatically switches to their "my documents" folder.  Can I do this?  Right now, the excel is fine, but when you click on File-Save As the file format (save as type) comes up as Web Page, and the name is in quotes.  If you just switch the format to ex...

Could PB .NET Web Form POST security Information to others web page??
This is a multi-part message in MIME format. ------=_NextPart_000_00F9_01C9C4D5.8FB45C90 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable Hi,=20 Have anyone came across the requesion to POST security informations from = PB .NET web form web page to other web site?? I have tried many datys, Could any kind man give me some suggessions?? thanks & Best regards Leon ------=_NextPart_000_00F9_01C9C4D5.8FB45C90 Content-Type: text/html; charset="big5" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML P...

Using OWC to create an interactive excel with graogh in web page and export to excel file?
I am able to create interactive graphs and excel raw data in web page Using OWC . I can export the raw data in excel . The limitation I found to export the chart along with the raw data in same  to excel file in same work sheet or different work sheet as interactive. ie After export to excel file when you change the raw data in excel file , graph needs to be chnaged. It would be great help for me getting some responses to know is it possible Using OWC . Thanks in advance  ...

Multiple Page Web-forms, without passing earlier pages values to the next one?
I am using RH9, postgreSQL and perl5. Is it possible to get users to submit multiple page web-forms but not to pass values from one form to the next? I would like to store each page to the database server as it is submitted. Also, to build in the process to resume the web-form submission at a later time e.g say there are twent pages to submit and the user stops feeding the forms at the tenth form. I would like to email the user a reminder so he can log back in and start from the eleventh form. Can anyone tell me if this sort of thing is implemented anywhere, so I can study it. Or, can anyone p...

Export data from web form to excel -- using client's excel app
I am currently trying to figure out if there is any way to export data to the client's excel app. I do not want to use the web server's excel application as it is cutting into the site's performance. Is there any way to use something similar to the what is included below (ExportComponent.vb), but to use the client's excel app? Imports System.Drawing.Color Public Class ExportComponent Inherits System.ComponentModel.Component Public Shared Sub DataToExcel(ByVal dgData As DataGrid, ByVal response As HttpResponse) response.Clear() response.Charse...

how to open a web page in form of a popup web page
Hello, I have two web pages, let say. Page A : With a Button on it. PAge B: with some info. Now I need to: When I click on the Button of page A.Page B must open in a pop up window.  I can do this but problem is this when I clicked on the button for first time it does not show me any thing and when I clicked on the button for second time then It shows me Page B .My code is as follow:  1 protected void Page_Load(object sender, EventArgs e) 2 { 3 if (!this.Page.IsPostBack) 4 { 5 6 } 7 else 8...

how can you display another web site's web page in your web page without leaving your site
Can you display another web site's web page in your web page without leaving your site? I know you could use a frameset with .asp, but it looks like Visual Web Delevoper 2005 does not have any controls to setup a frameset. Any help, that would point me in the right direction would be great. Thanks Patrick     With screen scraping 4GuysFromRolla.Com: Screen Scrapes in ASP.NEThttp://www.4guysfromrolla.com/webtech/070601-1.shtmlThanks,Teemu KeiskiFinland, EU Thank you. This information was a great help!!! Thanks again Patrick...

Exporting to Excel in Crystal Reports .NET
sir,   I want to export Crystal report to Excel and the following is the code i wrote in the button click.ReportDocument rptExcel = new ReportDocument() ;string strExportFile = "C:/Session_SessionID.xls" ;rptExcel = new RptJobOrderRecap();//report namerptExcel.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile ;rptExcel.ExportOptions.ExportFormatType = ExportFormatType.Excel;ExcelFormatOptions objExcelOptions = new ExcelFormatOptions();objExcelOptions.ExcelUseConstantColumnWidth = false ;rptExcel.ExportOptions.FormatOptions = objExcelOptions ;DiskFileDestinationOp...

Web resources about - export to excel without page content? - asp.net.web-forms

Help:Contents - Wikipedia, the free encyclopedia
Templates are special pages that contain boilerplate text intended to be displayed on more than one page in Wikipedia. This Tip of the day box ...

Portal:Contents/Culture and the arts - Wikipedia, the free encyclopedia
The word culture is derived from the Latin root cultura or cultus meaning to "inhabit, cultivate, or honour". In general, culture refers to human ...

Michael Jones content to man Brumbies ship and steer clear of Sydney to Hobart
Brumbies boss Michael Jones doubts he will ever tick the Sydney to Hobart off his bucket list.

Looking Back at 2015 Content Marketing Trends
Earlier this year, content marketers expected to increase their budgets, expand their offerings, and deepen their commitment to content marketing. ...

Dell Issues Patch For Content Adaptive Brightness Control On The XPS 13
... the year, but it did have some issues, as all devices do. One that was very frustrating to deal with during the review was the aggressive Content ...

A new Vudu update turns a Spotlight on best movie deals, free content and more
... with Spotlight search and offline file support . VUDU - Movies & TV A new Vudu update turns a Spotlight on best movie deals, free content ...

More 4K content on the way to your TV very soon
... future it is a prudent move to future-proof and be ready for what is coming. Now UltraFlix is announcing its plans to provide a lot more content ...

How to Make Money Sharing Sponsored Content Without Annoying Your Followers
It's widely accepted that sponsored content is a part of social media now. Not only do we see ads inserted into our streams by Facebook, Instagram, ...

Netflix's success could be bad news for content companies, analysts say
Streaming giants like Netflix and Amazon have been pouring money into putting out their own original content instead of licensing old shows from ...

Battlefront probably isn't getting any content from The Force Awakens
While it would already seem like EA missed the boat if they were planning on adding anything based on The Force Awakens to Battlefront , a recent ...

Resources last updated: 12/26/2015 6:49:47 PM