LocalReport localReport = new LocalReport();
localReport.ReportPath = Server.MapPath("~/Controllers/Report/Report1.rdlc");
ReportDataSource reportDataSource = new ReportDataSource("DataSet1",db.authors.ToList());
localReport.DataSources.Add(reportDataSource);
string reportType = "PDF";
string mimeType;
string encoding;
string fileNameExtension;
string deviceInfo =
"
"
"
"
"
"
"
"
"
Warning[] warnings;
string[] streams;
byte[] renderedBytes;
//Render the report
renderedBytes = localReport.Render(
reportType,
deviceInfo,
out mimeType,
out encoding,
out fileNameExtension,
out streams,
out warnings);
//Response.AddHeader("content-disposition", "attachment; filename=NorthWindCustomers." + fileNameExtension);
return File(renderedBytes, mimeType);