user3067593
user3067593

Reputation: 5

How to export data to an excel file from multiple pages on a website build in .NET MVC

My web application is build using in asp.net MVC. I am getting data from multiple db sources. I want to facilitate the export of data retrieved using multiple controllers, displayed on multiple pages, to an excel file. Is it possible to do that? If yes, then can someone point to a resource? All I can find is to export data from one page or from one controller. Thanks.

Upvotes: 0

Views: 172

Answers (2)

SBirthare
SBirthare

Reputation: 5137

All you need to do is, create a Action method which is responsible to collect data from all the sources. You may have various services that retrieve data from different data sources.

The key is to collect all the data in one object and then hand it over to export-to-excel library.

Upvotes: 1

Vladimirs
Vladimirs

Reputation: 8609

You can build single action that represents report you want which comprises all required data for your report and then export it in way that your found for "one page".

Upvotes: 0

Related Questions