Posts

Showing posts from September, 2024

ASP.NET Core 8 API: Opening Excel File On The Server and Return its contents in JSON format

Image
ASP.NET Core is the best technology for building WEB Apps and API Services. The ASP.NET Core API offers features for building Data Communication services. We can connect various data providers to read their data and return it to the client applications. One such capability is to open an Excel file on the server and read its contents so that the client can respond to them in JSON format. Excel files play a very important role in storing data so that this data can be used for various business intelligence processes. We can develop ASP.NET Core API to directly open the Excel file on the server and return its contents to the client without downloading the file on the client. Figure 1 shows the application development process. Figure 1: Reading Excel file using ASP.NET Core API app The advantage of the above approach is that the file is available on the server and its data is sent to the client. To implement the solution we will be using the ExcelDataReader.DataSet package. This package is