The tutorial I am using creates a list which is not what I want to do but I thought I would try it and see if i could get it to work. I changed my routine to the following and re ran the program. I am now getting the the following error message at the same location DataSet does not support System.Nullable<>. There are no null rows in my table and non of the rows allow for null.
Do you have any idea how I could get this working? Thank You
public ActionResult ExportReport(int? id)
{
List<injuryillness> i = new List<injuryillness>();
using (wgo_InjuryIllnessEntities dc = new wgo_InjuryIllnessEntities())
{
i = dc.InjuryIllnesses.ToList();
}
ReportDocument rd = new ReportDocument();
rd.Load(Path.Combine(Server.MapPath("~/Reports"), "Report_InjuryIllness.rpt"));
rd.SetDataSource(i);
Response.Buffer = false;
Response.ClearContent();
Response.ClearHeaders();
try
{
Stream stream = rd.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
stream.Seek(0, SeekOrigin.Begin);
return File(stream, "application/pdf", "Report_InjuryIllness.pdf");
}
catch (Exception ex)
{
throw;
}
}</injuryillness></injuryillness>