Skip to main content

Posts

Showing posts with the label downloading code in .net core api

Report generation in .Net Core API

  In this tutorial we will learn about quick way to generate reports using .net core api. When we work in companies, we may face a situation where client ask to generate reports, and he is not ready to spend money in purchasing third party libraries to get reports. Apart from this he want to work to done in same day or he has some urgency. In this situation this tutorial will helpful where we need to generate reports in single day without spending and wasting time in research. Let’s Start. a. We will create .Net core API. b. Create Endpoint for Download file c. Make a call to database and fetch data. d. Create report in html format and send html file back to user as response. Consider we connect to database and get below data table Consider code below using Microsoft.AspNetCore.Mvc; using System.Data; using System.Text; // For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 namespace DownloadFile.Controllers { [ ...