Trying to get a report to print from the Print Button on a GridView Page.
When I run the report I get the following error.
Code:
DataSet does not support System.Nullable<>.
This are my SP, DAL, BLL
Stored Procedure
Code:
ALTER PROCEDURE dbo.ReportTransfersPastWeek
AS
SET NOCOUNT ON
SELECT RequestDate, pName, dob, transFacility, transferReasons, transferDecision
FROM AETransfer
WHERE RequestDate >= dateadd(day, datediff(day,0,GetDate())-7,0)
RETURN
This pulls the entries from the current date to the last 7 seven days.
DAL
Code:
publicclassReportTransfersPastWeekData
{
publicstaticList<ReportTransfersPastWeekResult> SelectPastWeekTransfers()
{
using (HRPaidTimeOffDataContext db = newHRPaidTimeOffDataContext(DBHelper.GetHRPaidTimeOffConnectionString()))
{
return db.ReportTransfersPastWeek().ToList();
}
}
}
BLL
Code:
publicclassReportTransfersPastWeek
{
publicstaticobject[] SelectPastWeekTransfers()
{
returnReportTransfersPastWeekData.SelectPastWeekTransfers().ToArray();
}
}
}
The error happens on this line of code in the GridView Page.
Code:
void Master_PrintButton_Click(object sender, EventArgs e)
{
ReportDocument report = newReportDocument();
report.Load(Server.MapPath("Reports/TransfersPastWeek.rpt"));
//Get the data
report.SetDataSource(ReportTransfersPastWeek.SelectPastWeekTransfers()); <<<Fails
report.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, false, "");
}
Any help would be appreciated. I ran my SQL on the data and it returns valid results. What is going on with the code and design pattern?