+ Reply to Thread
Results 1 to 3 of 3

Thread: Export to Excel file prompt

  1. #1
    Barn Legend Rebelle will become famous soon enough Rebelle's Avatar
    Join Date
    Mar 2008
    Posts
    1,522
    Rep Power
    5

    Export to Excel file prompt

    Hi All,

    Ok, I have the following button to prompt to export asp page data to excel...

    Code:
    function exportToExcel(){
          answer = confirm("Are you sure you want to export? Click Save and export to your computer!") 
          if (answer == 1)
              location.href = "TestExcel.asp?DistrictID=<%= sDistricts %>&TypeID=<%= sTypeID %>"
    }
    
    The TestExcel.asp page uses:
    Code:
    Response.ContentType = "application/vnd.ms-excel"
    
    Well, if I pass TypeID=1 or 2 or nothing it works fine...but when passing =3 it doesn't work...

    when you get the prompt to "Open" or "Save" it displays you the

    FileName:
    Type:
    From:

    Well, instead of showing the normal info like so:
    Code:
    FileName: TestExcel.asp
    Type: Microsoft Excel Worksheet, 218kb
    From: servername
    
    when I pass =3 it shows me this and doesn't download:
    Code:
    FileName: ...TestExcel_asp?DistrictID=2TypeID=3
    Type: Microsoft Excel Worksheet, 25.0kb
    From: servername
    

  2. #2
    Barn Legend Rebelle will become famous soon enough Rebelle's Avatar
    Join Date
    Mar 2008
    Posts
    1,522
    Rep Power
    5

    Ok, I had another thread regarding removing the formatcurrency...I removed those from this excel.asp page and all is good..

  3. #3
    Barn Legend Rebelle will become famous soon enough Rebelle's Avatar
    Join Date
    Mar 2008
    Posts
    1,522
    Rep Power
    5

    Just found this could also be related to a field name does not exist in query. As soon as I removed all worked fine.

+ Reply to Thread

Similar Threads

  1. CSV File Export Tip...
    By Lauramc in forum SQL Server Reporting Services Help
    Replies: 12
    Last Post: July 27th, 2011, 12:08 PM
  2. export gridview to excel add multiple sheets
    By peebman2000 in forum .NET Development
    Replies: 6
    Last Post: November 20th, 2009, 01:57 PM
  3. Export to Excel - multiple tabs?
    By Rebelle in forum ASP Development
    Replies: 1
    Last Post: May 4th, 2009, 04:48 PM
  4. Export to Excel SSRS 2000 Unreadable Content Error
    By Lauramc in forum SQL Server Reporting Services Help
    Replies: 1
    Last Post: April 24th, 2009, 09:02 AM
  5. export to excel function prompt help
    By Rebelle in forum JavaScript Programming
    Replies: 2
    Last Post: April 14th, 2008, 11:40 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO