Created
September 26, 2022 14:00
-
-
Save monir-dev/deb3e526151863443eb6c451e752620c to your computer and use it in GitHub Desktop.
RDLC report show inside aspdotnet core application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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