Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save monir-dev/deb3e526151863443eb6c451e752620c to your computer and use it in GitHub Desktop.
Save monir-dev/deb3e526151863443eb6c451e752620c to your computer and use it in GitHub Desktop.
RDLC report show inside aspdotnet core application
public IActionResult RdlcReportPreview()
{
// Require package: AspNetCore.Reporting
var path = $"{this._IWebHostEnvironment.WebRootPath}\\Report\\NewReport.rdlc"; // Local Path
AspNetCore.Reporting.LocalReport localReport = new LocalReport(path);
localReport.AddDataSource("DataSetOne", #DataListOne);
localReport.AddDataSource("DataSetTwo", #DataListTwo);
var result = localReport.Execute(RenderType.Pdf, 1, new Dictionary<string, string>(), "");
return File(result.MainStream, "application/pdf");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment