Hello, I have this controller to generate a PDF report:
public ActionResult Report(string id)
{
LocalReport lr = new LocalReport();
string path = Path.Combine(Server.MapPath("~/Report"), "Person.rdlc");
if (System.IO.File.Exists(path))
{
lr.ReportPath = path;
}
else
{
return View("Index");
}
List<Person> cm = new List<Person>();
var viewModel = new PersonIndexData();
viewModel.People= db.Person
.Include(k => k.Groups)
.OrderBy(k => k.Name);
cm = viewModel.People.ToList();
ReportDataSource rd = new ReportDataSource("PersonDataSet", cm);
lr.DataSources.Add(rd);
string reportType = id;
string mimeType;
...
Go to the complete details ...