コード例 #1
0
ファイル: frm_DONGANH.cs プロジェクト: liyang-live/LabUI
        /// <summary>
        /// HÀM THỰC HIỆN IN BÁO CÁO
        /// </summary>
        /// <param name="m_dsReport"></param>
        private void INBAOCAO(DataTable m_dsReport)
        {
            //var DT = new ds_dailyDetailTestReport.dtDailyDetailTestReportDataTable();

            string sTungayDenNgay = dtpFromDate.Value.Date != dtpTodate.Value.Date
                                        ? string.Format("{0} --- đến --- {1}", Getsday(dtpFromDate.Value),
                                                        Getsday(dtpTodate.Value))
                                        : Getsday(dtpFromDate.Value);

            if (!InvaliData(m_dtDataReport))
            {
                return;
            }
            var crpt    = new crpt_DailyTotalTestReportDetailVNIO();
            var objForm = new frmPrintPreview("", crpt, true, true);

            try
            {
                crpt.SetDataSource(m_dsReport);
                crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + "        NHÂN VIÊN                                             TRƯỞNG KHOA                   ".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
                crpt.SetParameterValue("ParentBranchName", globalVariables.ParentBranch_Name);
                crpt.SetParameterValue("BranchName", globalVariables.Branch_Name);
                crpt.SetParameterValue("sTungayDenNgay", sTungayDenNgay);
                // crpt.SetParameterValue("TotalTest", intGetTotalTest( DT));
                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
                Utility.DefaultNow(this);
            }
            catch (Exception ex)
            {
                Utility.DefaultNow(this);
            }
        }
コード例 #2
0
        private void PrintReportDetailTotalTest(DataTable m_dsReport)
        {
            var    DT             = new ds_dailyDetailTestReport.dtDailyDetailTestReportDataTable();
            string sTungayDenNgay = Getsday(Convert.ToDateTime(dtpFromDate.Text)) + " --- đến --- " +
                                    Getsday(Convert.ToDateTime(dtpTodate.Text));

            if (!InvaliData(_dsReport))
            {
                return;
            }
            var crpt    = new VD_1C_crpt_DailyParamTestReport1();
            var objForm = new frmPrintPreview("", crpt, true, true);

            try
            {
                crpt.SetDataSource(m_dsReport);
                //crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) +
                //                                                      "    Nhân viên                                                                   "
                //                                                          .Replace("#$X$#",
                //                                                                   Strings.Chr(34) + "&Chr(13)&" +
                //                                                                   Strings.Chr(34)) + Strings.Chr(34);
                crpt.SetParameterValue("ParentBranchName", globalVariables.ParentBranch_Name);
                crpt.SetParameterValue("BranchName", globalVariables.Branch_Name);
                crpt.SetParameterValue("sCondition", sTungayDenNgay);
                // crpt.SetParameterValue("TotalTest", intGetTotalTest( DT));
                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
                Utility.DefaultNow(this);
            }
            catch (Exception ex)
            {
                Utility.DefaultNow(this);
            }
        }
コード例 #3
0
        private void PrintReportDetailTotalTest(DataTable m_dsReport)
        {
            //var DT = new ds_dailyDetailTestReport.dtDailyDetailTestReportDataTable();

            string sTungayDenNgay = dtpFromDate.Value.Date != dtpTodate.Value.Date
                                        ? string.Format("{0} --- đến --- {1}", Getsday(dtpFromDate.Value),
                                                        Getsday(dtpTodate.Value))
                                        : Getsday(dtpFromDate.Value);

            if (!InvaliData(_dsReport))
            {
                return;
            }
            var crpt    = new crpt_DailyTotalTestReportDetailVNIO();
            var objForm = new frmPrintPreview("", crpt, true, true);

            try
            {
                crpt.SetDataSource(m_dsReport);
                crpt.SetParameterValue("ParentBranchName", globalVariables.ParentBranch_Name);
                crpt.SetParameterValue("BranchName", globalVariables.Branch_Name);
                crpt.SetParameterValue("sTungayDenNgay", sTungayDenNgay);
                // crpt.SetParameterValue("TotalTest", intGetTotalTest( DT));
                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
                Utility.DefaultNow(this);
            }
            catch (Exception ex)
            {
                Utility.DefaultNow(this);
            }
        }
コード例 #4
0
        private void PrintCreenTest(DataTable m_dsReport)
        {
            if (!InvaliData(m_dsReport))
            {
                return;
            }
            var crpt    = new crpt_CreenTest();
            var objForm = new frmPrintPreview("", crpt, true, true);

            try
            {
                crpt.SetDataSource(m_dsReport);
                //crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + "    Nhân viên                                                                   ".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
                crpt.SetParameterValue("ParentBranchName",
                                       LablinkBusinessConfig.GetParentBranchName());
                crpt.SetParameterValue("Para_1", "1");
                crpt.SetParameterValue("Para_2", "2");
                crpt.SetParameterValue("Para_3", "3");
                crpt.SetParameterValue("Para_4", "4");
                crpt.SetParameterValue("Para_5", "5");
                crpt.SetParameterValue("BranchName", LablinkBusinessConfig.GetBranchName());
                crpt.SetParameterValue("sTuNgayDenNgay", Utility.FromToDateTime(dtpFromDate.Text, dtpTodate.Text));
                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
                Utility.DefaultNow(this);
            }
            catch (Exception ex)
            {
                Utility.DefaultNow(this);
            }
        }
コード例 #5
0
        /// <summary>
        /// thuc hien in bao cao theo kieu thu 3 la in bao cao so luong hang ngay
        /// </summary>
        /// <param name="m_dsReport"></param>
        private void PrintDaily(DataTable m_dsReport)
        {
            if (!InvaliData(_dsReport))
            {
                return;
            }
            var crpt    = new crpt_ThongkesoluongXN();
            var objForm = new frmPrintPreview("", crpt, true, true);

            try
            {
                crpt.SetDataSource(m_dsReport);
                crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) +
                                                                      "    Nhân viên                                                                   "
                                                                      .Replace("#$X$#",
                                                                               Strings.Chr(34) + "&Chr(13)&" +
                                                                               Strings.Chr(34)) + Strings.Chr(34);
                crpt.SetParameterValue("ParentBranchName",
                                       LablinkBusinessConfig.GetParentBranchName());
                crpt.SetParameterValue("BranchName", LablinkBusinessConfig.GetBranchName());
                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
                Utility.DefaultNow(this);
            }
            catch (Exception ex)
            {
                Utility.DefaultNow(this);
            }
        }
コード例 #6
0
        /// <summary>
        /// hàm thực hiện in báo cáo số lượng hàng ngày
        /// Kiểu báo cáo số 2
        /// </summary>
        /// <param name="m_dsReport"></param>
        private void PrintForCountingEachTest(DataTable m_dsReport)
        {
            if (!InvaliData(_dsReport))
            {
                return;
            }
            var crpt    = new crpt_DailyTestReportDetail();
            var objForm = new frmPrintPreview("", crpt, true, true);

            try
            {
                //foreach (DataRow dr in m_dsReport.Rows)
                //{
                //    dr["PrintDetail"] = 1;

                //}
                //m_dsReport.AcceptChanges();
                crpt.SetDataSource(m_dsReport);
                crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) +
                                                                      "    Nhân viên                                                                   "
                                                                      .Replace("#$X$#",
                                                                               Strings.Chr(34) + "&Chr(13)&" +
                                                                               Strings.Chr(34)) + Strings.Chr(34);
                crpt.SetParameterValue("ParentBranchName",
                                       LablinkBusinessConfig.GetParentBranchName());
                crpt.SetParameterValue("BranchName", LablinkBusinessConfig.GetBranchName());
                crpt.SetParameterValue("TotalTest", GetTotalTest(m_dsReport));
                crpt.SetParameterValue("sTuNgayDenNgay", Utility.FromToDateTime(dtpFromDate.Text, dtpTodate.Text));
                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
                Utility.DefaultNow(this);
            }
            catch (Exception ex)
            {
                Utility.DefaultNow(this);
            }
        }