Exemple #1
0
 private void navItem_Chitiet_Tienmuahang_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
 {
     Reports.XtraReports.rptWare_Muahang_Chitiet rptWare_Muahang = new Ecm.Reports.XtraReports.rptWare_Muahang_Chitiet();
     setHesoChuongtrinh(rptWare_Muahang.xrc_CompanyName, rptWare_Muahang.xrc_CompanyAddress, rptWare_Muahang.xrPic_Logo);
     printControl_Baocao.PrintingSystem = rptWare_Muahang.PrintingSystem;
     this.report = "rptWare_Muahang_Chitiet";
     rptWare_Muahang.CreateDocument();
     Loaddata();
 }
Exemple #2
0
        void LoadRptChitiet_Hangmua()
        {
            System.Collections.Hashtable hastTable = new System.Collections.Hashtable();
            hastTable.Add(dtNgay_Batdau, lblNgay_Batdau.Text);
            hastTable.Add(dtNgay_Ketthuc, lblNgay_Ketthuc.Text);
            //hastTable.Add(lookUpEdit_Doituong, lblDoituong.Text);

            if (!GoobizFrame.Windows.MdiUtils.Validator.CheckNullFields(hastTable))
            {
                return;
            }
            if (!GoobizFrame.Windows.MdiUtils.Validator.CheckDate(dtNgay_Batdau, dtNgay_Ketthuc))
            {
                return;
            }

            Reports.XtraReports.rptWare_Muahang_Chitiet rptWare_Muahang = new Ecm.Reports.XtraReports.rptWare_Muahang_Chitiet();
            Datasets.DsRptWare_Hdmuahang dsHdmuahang = new Ecm.Reports.Datasets.DsRptWare_Hdmuahang();
            DataSet dstemp = objWareService.Get_All_Ware_Hdmuahang_ByNhacungcap_ByDate(lookUpEdit_Doituong.EditValue, dtNgay_Batdau.EditValue, dtNgay_Ketthuc.EditValue).ToDataSet();
            int     i      = 1;

            foreach (DataRow dtr in dstemp.Tables[0].Rows)
            {
                DataRow dtrNew = dsHdmuahang.Tables[0].NewRow();
                foreach (DataColumn dtc in dstemp.Tables[0].Columns)
                {
                    try
                    {
                        dtrNew[dtc.ColumnName] = dtr[dtc.ColumnName];
                    }
                    catch (Exception ex)
                    {
                    }
                }
                dtrNew["Stt"] = i;
                i++;
                dsHdmuahang.Tables[0].Rows.Add(dtrNew);
            }
            setHesoChuongtrinh(rptWare_Muahang.xrc_CompanyName, rptWare_Muahang.xrc_CompanyAddress, rptWare_Muahang.xrPic_Logo);
            rptWare_Muahang.xrDate_From.Text = dtNgay_Batdau.Text;
            rptWare_Muahang.xrDate_To.Text   = dtNgay_Ketthuc.Text;
            rptWare_Muahang.xrNgayKy.Text    = DateTime.Now.Day.ToString();
            rptWare_Muahang.xrThangKy.Text   = DateTime.Now.Month.ToString();
            rptWare_Muahang.xrNamKy.Text     = DateTime.Now.Year.ToString();
            rptWare_Muahang.DataSource       = dsHdmuahang;

            GoobizFrame.Windows.Forms.FrmPrintPreview _FrmPrintPreview = new GoobizFrame.Windows.Forms.FrmPrintPreview();
            _FrmPrintPreview.Report = rptWare_Muahang;
            rptWare_Muahang.CreateDocument();
            GoobizFrame.Windows.Forms.ReportOptions oReportOptions = GoobizFrame.Windows.Forms.ReportOptions.GetReportOptions(rptWare_Muahang);
            if (Convert.ToBoolean(oReportOptions.PrintPreview))
            {
                _FrmPrintPreview.Text = "" + oReportOptions.Caption;
                _FrmPrintPreview.printControl1.PrintingSystem = rptWare_Muahang.PrintingSystem;
                _FrmPrintPreview.MdiParent = this.MdiParent;
                _FrmPrintPreview.Text      = this.Text + "(Xem trang in)";
            }
            else
            {
                var ReportPrintTool = new DevExpress.XtraReports.UI.ReportPrintTool(rptWare_Muahang);
                ReportPrintTool.Print();
            }
            _FrmPrintPreview.Show();
            _FrmPrintPreview.Activate();
        }