Ejemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            crtPhieuNhap rpt = new crtPhieuNhap();

            rpt.Site = this.Site;
            return(rpt);
        }
Ejemplo n.º 2
0
        private void LoadReportSource(string _MaKho)
        {
            //crtPhieuNhap cry = new crtPhieuNhap();
            var model = from m in db.ChiTietPhieuNhaps.AsEnumerable()
                        join vt in db.VatTus.AsEnumerable() on m.MaVT equals vt.MaVT
                        join pn in db.PhieuNhaps.AsEnumerable() on m.MaPhieuNhap equals pn.MaPhieuNhap
                        join ncc in db.NhaCungCaps.AsEnumerable() on vt.MaNCC equals ncc.MaNCC
                        join kho in db.KhoVatTus.AsEnumerable() on pn.MaKhoVT equals kho.MaKhoVT
                        where m.MaPhieuNhap.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.TrangThai,
                                DVT          = vt.DVT,
                                SoLuong      = m.SoLuong,
                                DonGia       = vt.DonGia != null?vt.DonGia.Value.ToString("#") : ""
            };
            ReportDocument StockObjectsReport = new crtPhieuNhap();

            StockObjectsReport.SetDataSource(model.ToList());
            cryView1.ReportSource = StockObjectsReport;
            cryView1.RefreshReport();
        }