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

  • Home
  • SEARCH
  • 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 8814889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:14:27+00:00 2026-06-14T04:14:27+00:00

I have to export very large files as an excel export. Since .NET can’t

  • 0

I have to export very large files as an “excel export”. Since .NET can’t export excel files, I went with simple html tables.

It works fine, but it’s slow.

Is it possible to context.response.write each line as they’re being created instead of building some super huge string and trying to export the whole thing once it’s done?

I could care less what function is used to do this, but I hope you know what I mean. I don’t want to build a string into memory and then try to send it all at once. I’d rather export as I build the table.

Is this possible?

Thanks in advance!

  • 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-14T04:14:29+00:00Added an answer on June 14, 2026 at 4:14 am

    Yes, using context.Response.Write on each line is just fine. If the reason for not wanting to build a large string is server memory use, then you’ll need to turn off response buffering like so:

    context.Response.BufferOutput = false;
    

    Otherwise, .NET will just buffer your writes in memory until the end, anyway.

    If the reason is execution time, then you may be experiencing performance hits from multiple string concatenations. In that case, you could use the StringBuilder class to construct the table instead.

    For example…

    StringBuilder sb = new StringBuilder();
    for each (<row in database>) {
        sb.AppendLine(<current table row>);
    }
    context.Response.Write(sb.ToString());
    

    More info on response buffering:
    http://msdn.microsoft.com/en-us/library/system.web.httpresponse.bufferoutput.aspx

    More info on the StringBuilder class:
    http://msdn.microsoft.com/en-us/library/system.text.stringbuilder(v=vs.110).aspx

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

Sidebar

Related Questions

I have a very simple question. How can I export Java program like this
We have an application that exports very large data files to a windows network
I have a very simple question. I have been trying to export a set
At work we have a very large code-base that we commonly export for a
i have very serious problem if any tech expert can help...thank you in advance..
I have been trying to export the charts from Excel as an image file
I have to do an export from DB to CSV. ( .NET 2 )
I have a very simple file upload PHP script. I am testing with a
I have a number of rather large binary files (fixed length records, the layout
I have a very large, dense, labeled graph that I have visualized with GraphPlot.

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.