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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:49:09+00:00 2026-05-24T09:49:09+00:00

I have a 3-tier web application (database, app tier, web tier) written in MVC.

  • 0

I have a 3-tier web application (database, app tier, web tier) written in MVC.

I want to generate Excel files at runtime using the data from the database.

My initial idea is to reference Excel Library in the web project and generate the file in the controller. I can stream it directly to the response and I can treat the file as a different view of the data. I already have a service method in place that returns the data from the database, as it is used on a page.

I am considering file generation on the app tier and then returning byte[] to web tier. The argument here is that the file generation is part of business logic.

What would you do?

  • 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-05-24T09:49:10+00:00Added an answer on May 24, 2026 at 9:49 am

    The excel output is actually a responsibility of the view, so you MUST do this in the controller. The model/app tier is responsible for data only, not the representation of it.

    If you are using ASP.Net MVC you can declare an ExcelActionResult which takes in the view model and transforms it to a CSV/Excel output. Some related information:

    Custom Excel Export Action

    http://stephenwalther.com/blog/archive/2008/06/16/asp-net-mvc-tip-2-create-a-custom-action-result-that-returns-microsoft-excel-documents.aspx

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

Sidebar

Related Questions

I have a web-app-database 3 tier server setup. Web requests data from app, and
I have a 3-tier web application using MVC - WCF - MSSQL . I
I have a basic 3 tier app Presentation/Web (ASP.NET MVC) Application Services (WCF, hosted
I have a classic 3-tier web application build with MySQL and Tomcat. I want
We have a 3-tier web application written in ASP.Net Webforms where we will not
I have a three tier web app that produces three separate dlls: Web.UI.dll Web.Application.dll
I have a three tier system, SQL Server backend, hand written data access layer,
I have a three-tier Windows Forms DB application in VB.NET. I'm using VS 2005.
I have simple 3 tier web application and have mostly CRUDE functionalities. Recently I
I have inherited a conventional three tier web app with ASP.net 2.0 for the

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.