|
-
Sep 29th, 2009, 11:37 AM
#1
Thread Starter
Addicted Member
[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
Failing to plan is Planning to fail 
-
Sep 29th, 2009, 11:58 AM
#2
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
-
Sep 29th, 2009, 12:05 PM
#3
Thread Starter
Addicted Member
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
Failing to plan is Planning to fail 
-
Sep 29th, 2009, 12:58 PM
#4
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.
-
Sep 29th, 2009, 01:55 PM
#5
Thread Starter
Addicted Member
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
Failing to plan is Planning to fail 
-
Sep 30th, 2009, 01:03 AM
#6
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
-
Oct 1st, 2009, 03:33 AM
#7
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
-
Oct 1st, 2009, 04:23 AM
#8
Thread Starter
Addicted Member
Re: Download and save in excel
Hi
Thanks friends. I got it.
Failing to plan is Planning to fail 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|