Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8130663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:48:19+00:00 2026-06-06T08:48:19+00:00

we had some demands here in my job that include working with asp. We

  • 0

we had some demands here in my job that include working with asp.
We are not experient with that and I could not find a solution to this problem in the other topics here in stackoverflow

the thing is, if I put

<%  Option Explicit
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment; filename=excelTest.xls"
%>

the whole page goes to the excel file.

and I want only one table to be in the generated xls file.

the table I want is beeing generated by this line:

<% =Result %>

how can that be achieved?

thxxx

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T08:48:21+00:00Added an answer on June 6, 2026 at 8:48 am

    You’ll need something in your URL that makes the request for the XLS version distinct from the standard version.

    Typically you do this with a query string value so your URL becomes http://yoursite.com/yourpage.asp?mode=xls.

    Now in your code you can use:

    <%
    Option Explict
    Dim result
    
    ''# Build Table into result variable
    
    If Request.QueryString("mode") = "xls" Then 
        Response.ContentType = "application/vnd.ms-excel"    
        Response.AddHeader "Content-Disposition", "attachment; filename=excelTest.xls" 
    Else
    %>
    <html>
        <!-- Normal HTML before the table here -->
    <%
    End If
    
    Response.Write result
    
    If Request.QueryString("mode") <> "xls" Then
    %>
        <!-- Normal HTML after the table -->
    </html>
    <%
    End If
    %>
    

    In you include in your page a line back to itself with the extra ?mode=xls on the end the user will get excel launched with just the table loaded into it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had some code that produced a table, and worked perfectly. This is the
I had some code that looked like this: List<ListBoxItem> items = ( from String
I had some code that constructed an object: function gridObjConst(id, itemName, itemPrice, itemListPrice, width,
I had some experience of android but know almost nothing of GCC Makefile. Here
I had some code that ran commands through Runtime.getRuntime.exec(String) , and it worked on
I had some decryption code (using wincrypt.h ) that lived within my FileReader.cpp class.
I had some nice eclipse run configurations I had created while working on a
I had some tests working fine. Then, I moved it to a different package,
I've had some experience with Java and Javascript and searching this forum has helped
I had some fortran code that looked something like: subroutine foo(mx,my,mz) real pts(3,mx,my,mz) end

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.