ASP.NET Core: How to Create RDLC Report in ASP.NET Core

This post shows you How to Create RDLC Report with Parameters in ASP.NET Core MVC using AspNetCore.Reporting

To practice demo, you can create a new ASP.NET Core MVC project.

Next, Open your Startup class, then add routing to the Configure method as shown below.

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    if (env.IsDevelopment())


    app.UseEndpoints(endpoints =>
            name: "default",
            pattern: "{controller=Report}/{action=Print}/{id?}");

Next, Add an AddMvc method to the ConfigureServices method that allows you to use ASP.NET Core MVC.

public void ConfigureServices(IServiceCollection services)

Next, Add Controllers folder, then create a Report controller

Opening your ReportController, then add a Print action that allows you to render RDLC report in ASP.NET Core.

public IActionResult Print()


Next, Right-click on your project, then select Manage Nuget Packages => Search and Install 'AspNetCore.Reporting' into your project.

aspnetcore.reporting c#

This library supports LocalReport, ServerReport, SSRS, ReportViewer in ASP.NET Core.

 Next, You can create an ASP.NET MVC project or Windows Forms Application project to help you design the local report.

c# rdlc report with parameters

Next, Add a parameter to your local report, then you can design a simple report as shown above.

Finally, Copy your RDLC report inside Reports directory in ASP.NET Core project.

Next, Open the Program class in ASP.NET Core project, then modify your code allows you to use wwwroot directory.

public static IHostBuilder CreateHostBuilder(string[] args) =>
               .ConfigureWebHostDefaults(webBuilder =>

You should include the wwwroot directory into your ASP.NET Core project, then copy your local report inside this folder.

Next, Open the ReportController, then modify your code as shown below.

private readonly IWebHostEnvironment _webHostEnvirnoment;
private readonly IProductRepository _productRepository;

public ReportController(IWebHostEnvironment webHostEnvironment, IProductRepository productRepository)
    this._webHostEnvirnoment = webHostEnvironment;
    this._productRepository = productRepository;

You can use dependency injection to inject IWebHostEnvirnoment into your ReportController. This interface help you access data in wwwroot directory.

Next, Modify your Print action as shown below.

public IActionResult Print()
    string mimtype = "";
    int extension = 1;
    var path = $"{this._webHostEnvirnoment.WebRootPath}\\Reports\\Report1.rdlc";
    Dictionary<string, string> parameters = new Dictionary<string, string>();
    parameters.Add("rp1", "ASP.NET CORE RDLC Report");
    //get products from product table  
    LocalReport localReport = new LocalReport(path);
    var result = localReport.Execute(RenderType.Pdf, extension, parameters, mimtype);
    return File(result.MainStream, "application/pdf");

Press F5, to run your ASP.NET Project core rdlc report

You can also view the video tutorial belows to know how to render a RDLC Report with parameters using c# in core mvc.