Results 1 to 8 of 8

Thread: [RESOLVED] Download and save in excel

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Resolved [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

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    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

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Thumbs up 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

  6. #6
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Thumbs up 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
  •  



Click Here to Expand Forum to Full Width