Пример #1
0
        private void LoadReportSource(string _MaKho)
        {
            crtPhieuXuat cry   = new crtPhieuXuat();
            var          model = from m in db.ChiTietPhieuXuats
                                 join vt in db.VatTus on m.MaVT equals vt.MaVT
                                 join pn in db.PhieuXuats on m.MaPX equals pn.MaPX
                                 join ncc in db.NhaCungCaps on vt.MaNCC equals ncc.MaNCC
                                 join kho in db.KhoVatTus on pn.MaKhoXuat equals kho.MaKhoVT
                                 where m.MaPX.Equals(_MaKho)
                                 select new
            {
                NgayDuyet = pn.NgayDuyet != null?pn.NgayDuyet.Value.ToString("dd/MM/yyyy") : DateTime.Now.ToString("dd/MM/yyyy"),
                                TenKhoVT     = kho.TenKhoVT,
                                LyDo         = pn.NoiDung,
                                SerialNumber = m.SerialNumber,
                                TenVT        = vt.TenVT,
                                NhaCC        = ncc.TenNCC,
                                TrangThaiVT  = m.TrangThaiVT,
                                DVT          = vt.DVT,
                                SoLuong      = m.SoLuong,
                                DonGia       = vt.DonGia != null ? vt.DonGia.Value : 0
            };

            cry.SetDataSource(model.ToList());
            cryView1.ReportSource = cry;
            cryView1.RefreshReport();
        }
Пример #2
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            crtPhieuXuat rpt = new crtPhieuXuat();

            rpt.Site = this.Site;
            return(rpt);
        }