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

            rpt.Site = this.Site;
            return(rpt);
        }
Ejemplo n.º 2
0
        private void buttonVIEW_Click(object sender, EventArgs e)
        {
            long                    _kho  = long.Parse(comboBoxKHO.SelectedValue.ToString());
            DateTime                _from = dateTimePickerFROM.Value;
            DateTime                _to   = dateTimePickerTO.Value;
            BindingSource           bs    = new BindingSource();
            List <CNhapXuatTungKho> list  = new List <CNhapXuatTungKho>();
            // Tất cả hàng hóa
            var hh = (from _hh in DataInstance.Instance().DBContext().HANG_HOA orderby _hh.NAME select _hh);

            foreach (HANG_HOA h in hh)
            {
                CNhapXuatTungKho c = new CNhapXuatTungKho();
                c.HANGHOA = h.NAME;
                c.TONDAU  = MKho.TON_DAU(_kho, _from, h.ID);
                c.NHAP    = MKho.Total_Nhap_To(_kho, _from, _to, true, h.ID);
                c.XUAT    = MKho.Total_Xuat_To(_kho, _from, _to, true, h.ID);
                c.TONCUOI = MKho.TON_CUOI(_kho, _to, h.ID);
                list.Add(c);
            }
            bs.DataSource = list;
            CrystalReportNHAPXUATTUNGKHO rpt = new CrystalReportNHAPXUATTUNGKHO();

            rpt.SetDataSource(bs);
            rpt.SetParameterValue("KHO", comboBoxKHO.Text);
            rpt.SetParameterValue("FROM", dateTimePickerFROM.Value);
            rpt.SetParameterValue("TO", dateTimePickerTO.Value);
            rpt.SetParameterValue("COMP", ConstClass.COMPANY_NAME);
            crystalReportViewer1.ReportSource = rpt;
            crystalReportViewer1.Zoom(150);
        }