Is there any way to show RDLC Local ReportViewer control in asp.net core webpage?
To show a ReportViewer, on a traditional WebForms application, the below code works
public List _dataSourceList = new List(); public string _dataSourceName { get; set; } public string _reportPath = CommonUtil.Report_path; //set your report path in app.config file public Dictionary Parameters = new Dictionary(); public void PDFPrint_Load() { string mimtype=""; int extension = 1; LocalReport localReport= new LocalReport(_reportPath); localReport.AddDataSource(_dataSourceName, _dataSourceList); if (Parameters != null && Parameters.Count > 0)// if you use parameter in report { List reportparameter = new List(); foreach (var record in Parameters) { reportparameter.Add(new ReportParameter()); } } var result = localReport.Execute(RenderType.Pdf, extension,parameters: Parameters, mimtype); byte[] bytes = result.MainStream; string fileName = "Report.pdf"; return File(bytes , "application/pdf",fileName ); }