[RESOLVED] Download and save in excel
Hi,
I have one aspx page. This is account page. In this page i have one download button and print button. While i click print i need to print the page and i click the download that page account information will download and save in to excel. Is it possible?? Hope yours reply
Thanks
Re: Download and save in excel
Hey,
You are going to need to provide more information than that if you want someone to help you.
What is the content of the page? Is it some more of GridView that you are trying to save to excel?
Gary
Re: Download and save in excel
Hi gep,
Thanks for your reply. This page looks like below.
Accounts
---------------------------------------------------------
Your Invoice Invoice Rate
Introductory 1st year promotion discount £ 50.00
Total account paid via pay pal £ 50.00
* VAT has not been charged
Term of service 1 year
Print button download button
Its look like above
Re: Download and save in excel
To print the page, you can simply call javascript's window.open() from the link. To save to Excel, you can take the HTML contents of the page and Response.Write it out to the Excel file. How you get this HTML depends on what controls you have on the page.
Re: Download and save in excel
hi mendhak,
i have an asp.net button control for download. I need that while click download, its going like download action and save to excel. Also this information is in particular table. I have more tables in single aspx page. I need to save particular table in excel
Thanks
Re: Download and save in excel
Hey,
As I mentioned, don't create multiple threads for the same question:
http://www.vbforums.com/showthread.php?t=585902
One thing to point out is that using the Response.Write technique that myself and Mendhak have pointed out will not automatically save the file to the clients computer, as there is no way of easily interacting with their file system. Instead, the end user will be presented with a Save Dialogue box, where they can specify where to save the file.
Gary
Re: Download and save in excel
Use the RenderControl method to write the HTML out. An example of using RenderControl (the control doesn't matter) is here
Re: Download and save in excel
Hi
Thanks friends. I got it.