RDLC Reporting in ASP.NET Core using ReportViewerCore.NETCore

RDLC Reporting in ASP.NET Core using ReportViewerCore.NETCore

Traditionally, RDLC reports were tightly coupled with the Microsoft ReportViewer control in the .NET Framework. But in ASP.NET Core, there is no official ReportViewer control from Microsoft. Developers often wonder if they can still use RDLC reports in Core applications. The good news is – yes, you can!

Step-by-Step Process

  1. Install the ReportViewerCore.NETCore NuGet package:
    <PackageReference Include="ReportViewerCore.NETCore" Version="15.1.26" />
  2. Create your RDLC report file. Since Visual Studio doesn’t provide the “Report” item template for ASP.NET Core projects, the trick is:
    • Create the RDLC file in a .NET Framework project (e.g., console app).
    • Design the report using the Microsoft RDLC Report Designer extension for Visual Studio.
    • Copy the RDLC file into your ASP.NET Core project under a Reports folder.
  3. Register your RDLC file as an embedded resource in your .csproj:
    <EmbeddedResource Include="Reports\EmployeeReport.rdlc" />
  4. Use LocalReport to load and render the report into PDF, then send it to the client:
    
    string rdlcFilePath = Path.Combine(Directory.GetCurrentDirectory(), "Reports", "EmployeeReport.rdlc");
    LocalReport report = new LocalReport();
    using (var fs = System.IO.File.OpenRead(rdlcFilePath))
    {
        report.LoadReportDefinition(fs);
    }
    ReportDataSource rds = new ReportDataSource("DataSetEmployee", employees);
    report.DataSources.Add(rds);
    
    byte[] pdfBytes = report.Render("PDF");
    return File(pdfBytes, "application/pdf", $"My-Report-{DateTime.Now}.pdf");
                

Working Example

In my demo, I created an EmployeeRepository with sample data and passed it as a dataset to the RDLC. Parameters can also be passed using:

report.SetParameters(new ReportParameter("MyParamName", "Sudipto: " + DateTime.Now));

YouTube Tutorial

I have created a full step-by-step video tutorial that explains the complete setup in detail. You can watch it here: RDLC Reporting in ASP.NET Core (YouTube)

About Me

I am Sudipto, a Microsoft Certified Professional with over 20 years of experience in .NET technologies. I provide personalized 1-to-1 online training on C#, ASP.NET Core, MVC, Blazor, SQL Server, and more.

If you are looking to learn .NET from fundamentals to advanced or prepare for interviews, feel free to reach out:

Class Guidelines for Effective 1-on-1 Learning

To keep every session productive and distraction-free, please follow these simple guidelines:

  • Quiet Environment: Join from a calm, private room with minimal background noise. Avoid public or noisy places.
  • No Interruptions: Inform family/roommates in advance. Keep doors closed during class.
  • Mobile on Silent / DND: Set your phone to Silent or Do Not Disturb to prevent calls and notifications.
  • Be Fully Present: Do not multitask. Avoid attending to other calls, visitors, or errands during the session.
  • Stable Setup: Use a laptop/desktop with a stable internet connection and required software installed (Visual Studio/.NET, SQL Server, etc.).
  • Punctuality: Join on time so we can utilize the full session effectively.
  • Prepared Materials (If any): Keep project files, notes, and questions ready for quicker progress.

Following these guidelines helps you focus better and ensures I can deliver the best learning experience in every class.

Schedule a Quick 10-Minute Call

I prefer to start with a short 10-minute free call so I can understand:

  • Your learning objectives and career goals
  • Your current skill level
  • The exact topics you want to learn

Why? Because course content, teaching pace, and fees all depend on your needs — there’s no “one-size-fits-all” pricing. Please leave your details below, and I’ll get back to you to arrange a convenient time for the call.



Google Review Testimonials

.NET Online Training
Average Rating: 4.9
Votes: 50
Reviews: 50