Ejemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            AdminScript      adminScript = new AdminScript();
            string           sql_query   = "SELECT tbl_emp_id, tbl_emp_name, (SELECT COUNT(*) FROM `tbl_code_edit` WHERE `tbl_code_user_emp` = e.`tbl_emp_id` AND MONTH(tbl_code_date) = '" + date_start.Value.Month + "' AND YEAR(tbl_code_date) = '" + date_start.Value.Year + "') AS amount , `tbl_code_date`,tbl_cpoint_id,tbl_cpoint_name,tbl_code_note FROM `tbl_code_edit` LEFT JOIN `tbl_emp` e ON `tbl_code_user_emp` = tbl_emp_id LEFT JOIN `tbl_cpoint` ON `tbl_cpoint_id` = `tbl_code_cpoint` WHERE `tbl_code_status` IS NOT NULL AND MONTH(tbl_code_date) = '" + date_start.Value.Month + "' AND YEAR(tbl_code_date) = '" + date_start.Value.Year + "' ORDER BY tbl_cpoint_id,DATE_FORMAT(tbl_code_date,'%d-%m-%Y'),tbl_code_user_emp";
            MySqlDataAdapter adap        = new MySqlDataAdapter();
            MySqlConnection  conn        = new MySqlConnection(adminScript.strCon);
            MySqlCommand     cmd         = new MySqlCommand();;
            DataSet_Report   dataSet1    = new DataSet_Report();
            PopupReport      popup       = new PopupReport();
            string           nameCpoint  = script.GetCpoint(File.ReadAllText(script.file_cpoint).Split('|')[0]);

            popup.Text     = "รายงานการขอแก้ไขงาน ระบบ TIS";
            cmd.Connection = conn;
            conn.Close();
            conn.Open();
            cmd.CommandText = sql_query;

            adap.SelectCommand = cmd;
            dataSet1.Clear();
            adap.Fill(dataSet1, "report_EditJob");
            conn.Close();

            EditJob editJob = new EditJob();

            editJob.SetDataSource(dataSet1);

            /*DefectiveStrapsReport defectiveStraps = new DefectiveStrapsReport();
             * defectiveStraps.SetDataSource(dataSet1);
             * defectiveStraps.SetParameterValue("para_cpoint", nameCpoint);*/

            popup.cry_View.ReportSource = editJob;
            popup.Show();
        }
Ejemplo n.º 2
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            EditJob rpt = new EditJob();

            rpt.Site = this.Site;
            return(rpt);
        }