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!
ReportViewerCore.NETCore
NuGet package:
<PackageReference Include="ReportViewerCore.NETCore" Version="15.1.26" />
Reports
folder..csproj
:
<EmbeddedResource Include="Reports\EmployeeReport.rdlc" />
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");
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));
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)
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:
To keep every session productive and distraction-free, please follow these simple guidelines:
Following these guidelines helps you focus better and ensures I can deliver the best learning experience in every class.
I prefer to start with a short 10-minute free call so I can understand:
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.