You can use the ReportViewer object to render the RDLC in PDF or HTML. For my case (below) I need a PDF document and I returned it as an ActionCresult ActionResult. If you want it to return as a download, use File ActionResult (I commented on this for your use).
public ActionResult GetPackingSlipPDF(int shipmentId) { var shipment = _inboundShipmentService.GetInboundShipmentById(shipmentId); Warning[] warnings; string mimeType; string[] streamids; string encoding; string filenameExtension; var viewer = new ReportViewer(); viewer.LocalReport.ReportPath = @"Labels\PackingSlip.rdlc"; var shipLabel = new ShippingLabel { ShipmentId = shipment.FBAShipmentId, Barcode = GetBarcode(shipment.FBAShipmentId) }; viewer.LocalReport.DataSources.Add(new ReportDataSource("ShippingLabel", new List<ShippingLabel> { shipLabel })); viewer.LocalReport.Refresh(); var bytes = viewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out filenameExtension, out streamids, out warnings); return new FileContentResult(bytes, mimeType);
Providing RDLC report in HTML in ASP.NET MVC
source share