Mahesh Patil

Mahesh Patil

  • NA
  • 5
  • 14.6k

Problem Display Crystal Report Using Entity Framework In WPF

Oct 28 2013 12:49 AM

DataSet does not support System.Nullable<>

 This error is Occurred When ever I have fire the Entity Query For display Crystal Report

Query is Above : -

 

 ReportDocument rpt = new ReportDocument();
        rpt.Load(@"D:\Amar New\AmarNew\AmarNew\Report\Demo2.rpt");

        using (AmarNewEntities db = new AmarNewEntities())
        {
            rpt.SetDataSource(from v in db.Vouchers
                              join c in db.Customers
                               on v.LedgerID equals c.Cust_ID
                              join s in db.Stocks
                              on v.VoucherID equals s.VoucherID
                              join vd in db.VoucherDetails
                              on v.VoucherID equals vd.Voucher_ID
                              join i in db.Items
                              on s.Item_ID equals i.Item_ID
                              where v.VoucherID == vid
                              select new
                              {
                                  i.Item_Name,
                                  s.Quantity,
                                  s.Rate,
                                  s.Total,
                                  v.Grandtotal,
                                  v.VoucherID
                              });


            rpt.SetDataSource(from t in db.Banks
                              select new {t.Bank_ID,t.Bank_Name,t.ComapanyID});
        }

        crystalReportsViewer1.ViewerCore.ReportSource = rpt;

Any One Know About That Error . . . . .