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 8855539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:09:32+00:00 2026-06-14T14:09:32+00:00

In my application site I have a controller action creating and generating an Excel

  • 0

In my application site I have a controller action creating and generating an Excel file: from a list of items, it writes every field of every item through a for cycle.
Simplified example (coz I have ~30 fields):

String az = "";
az = az + "<table border=\"1\">";
az = az + "<tr>";
az = az + "<th>Field 1</th>";
az = az + "<th>Field 2</th>";
for (int i = 0; i < items.Count(); i++){
     az = az + "<tr>";
     az = az + "<td>" + items.ElementAt(i).Field1+ "</td>";
     az = az + "<td>" + items.ElementAt(i).Field2+ "</td>";
     az = az + "</tr>";
}
az = az + "</table>";

Now, when I have a few rows, no problem.
When I have a large number of rows, it takes a while generating the file. This is not a problem on localhost, but after I publish the site on IIS it takes until 7x(the time).

Example:

Loading 250 rows: 0,8s on localhost, 4s on IIS

Loading 615 rows: 4s on localhost, 21s on IIS

Loading 950 rows: 7s on localhost, 38s on IIS

Loading 1300 rows: 15s on localhost, 104s on IIS

Does anyone know what the problem is? Do I have to change/set some variable on the IIS site? In case I haven’t to, is there a way to optimize the performance on IIS?

Thanks, hope someone can help me!

  • 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-14T14:09:33+00:00Added an answer on June 14, 2026 at 2:09 pm

    First off if you have to build your html like this then at least use a string builder

    var az = new StringBuilder();
    az.append("<table border=\"1\">");
    az.append("<tr>");
    //etc
    return az.ToString();
    

    However, it might well be worthwhile to reconsider this approach entirely and look at using a Razor view instead of compiling your html. Of course this depends on other considerations you might have.

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

Sidebar

Related Questions

I have an existing application that imports data from a web site api into
I downloaded nUnit and TestDriven.net. I have a legacy Web Site application and I
I have an ASP.NET web application the entire site is browsed over HTTPS using
I'm currently working on an oophp application. I have a site class which will
I have read about application object in android site but I couldn't understand. What
I have created a site collection inside a web application with user A as
I have a window application which uses SP classes to create a site. I
i have watched a site which has taught iphone application using dashcode.it says dashcode
I have an application that uses Django 1.3 installed in python's site-packages. I want
I have a Clustered Windows Hosting site which currently hosts an MVC Web Application

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.