Ejemplo n.º 1
0
        private void PrintDailyDetailV2(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 crpt_DailyTestReportDetail();
            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("sTungayDenNgay", sTungayDenNgay);
                // crpt.SetParameterValue("TotalTest", intGetTotalTest( DT));
                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
                Utility.DefaultNow(this);
            }
            catch (Exception ex)
            {
                Utility.DefaultNow(this);
            }
        }
Ejemplo n.º 2
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);
            }
        }