private void label9_Click(object sender, EventArgs e)
        {
            //ATM REPORT
            CrystalDecisions.Shared.TableLogOnInfo li;

            //Print Purposes
            using (SqlConnection con = new SqlConnection(global.connectString()))
            {
                con.Open();

                SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM vw_SavingsReportDailyCheck", con);



                DataTable dt = new DataTable();
                DataSet   ds = new DataSet();

                ReportsForms.rptCheckDaily             cr  = new ReportsForms.rptCheckDaily();
                ReportsForms.rptSavingsWithdrawalDaily rpt = new ReportsForms.rptSavingsWithdrawalDaily();

                li = new TableLogOnInfo();

                li.ConnectionInfo.IntegratedSecurity = false;

                adapter.Fill(ds, "vw_SavingsReportDailyCheck");
                dt = ds.Tables["vw_SavingsReportDailyCheck"];
                cr.SetDataSource(ds.Tables["vw_SavingsReportDailyCheck"]);

                //cr.SetDatabaseLogon("sa", "SYSADMIN", "192.168.255.176", "PECCI-NEW");
                cr.SetDatabaseLogon(global.username, global.pass, global.datasource, global.initialCatalog);

                rpt.crystalReportViewer1.ReportSource = cr;
                rpt.crystalReportViewer1.RefreshReport();
                rpt.ShowDialog();
            }
        }
        private void label8_Click(object sender, EventArgs e)
        {
            //ATM REPORT
            CrystalDecisions.Shared.TableLogOnInfo li;

            //Print Purposes
            using (SqlConnection con = new SqlConnection(global.connectString()))
            {
                con.Open();

                SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM vw_ATMReportDaily", con);


                //Set Param

                //==================================================================================
                string         str          = "select Distinct(Bank_Code) as Bank_Code, Sum(AmtWithdrawn), JV_No FROM vw_ATMReportDaily WHERE Cancelled <> 1 GROUP BY Bank_Code, JV_No ORDER BY Bank_Code ASC";
                SqlDataAdapter adapterParam = new SqlDataAdapter(str, con);
                DataTable      dtParam      = new DataTable();
                adapterParam.Fill(dtParam);



                DataTable dt = new DataTable();
                DataSet   ds = new DataSet();

                ReportsForms.rptATMDaily cr = new ReportsForms.rptATMDaily();
                ReportsForms.rptSavingsWithdrawalDaily rpt = new ReportsForms.rptSavingsWithdrawalDaily();


                li = new TableLogOnInfo();

                li.ConnectionInfo.IntegratedSecurity = false;

                adapter.Fill(ds, "vw_ATMReportDaily");
                dt = ds.Tables["vw_ATMReportDaily"];
                cr.SetDataSource(ds.Tables["vw_ATMReportDaily"]);

                //cr.SetDatabaseLogon("sa", "SYSADMIN", "192.168.255.176", "PECCI-NEW");
                cr.SetDatabaseLogon(global.username, global.pass, global.datasource, global.initialCatalog);


                //==================================================================================================
                //                      HARDCODE PARAM FOR ATM LISTING DAILY
                //==================================================================================================
                if (dtParam.Rows.Count == 0)
                {
                    cr.SetParameterValue("param1", "");
                    cr.SetParameterValue("param2", "");
                    cr.SetParameterValue("param3", "");
                    cr.SetParameterValue("param4", "");
                    cr.SetParameterValue("param5", "");
                    cr.SetParameterValue("param6", "");
                    cr.SetParameterValue("param7", "");
                    cr.SetParameterValue("param8", "");
                    cr.SetParameterValue("param9", "");
                }

                if (dtParam.Rows.Count == 1)
                {
                    cr.SetParameterValue("param1", dtParam.Rows[0].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[0].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[0].ItemArray[2].ToString());
                    cr.SetParameterValue("param2", "");
                    cr.SetParameterValue("param3", "");
                    cr.SetParameterValue("param4", "");
                    cr.SetParameterValue("param5", "");
                    cr.SetParameterValue("param6", "");
                    cr.SetParameterValue("param7", "");
                    cr.SetParameterValue("param8", "");
                    cr.SetParameterValue("param9", "");
                }
                else if (dtParam.Rows.Count == 2)
                {
                    cr.SetParameterValue("param1", dtParam.Rows[0].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[0].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[0].ItemArray[2].ToString());
                    cr.SetParameterValue("param2", dtParam.Rows[1].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[1].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[1].ItemArray[2].ToString());
                    cr.SetParameterValue("param3", "");
                    cr.SetParameterValue("param4", "");
                    cr.SetParameterValue("param5", "");
                    cr.SetParameterValue("param6", "");
                    cr.SetParameterValue("param7", "");
                    cr.SetParameterValue("param8", "");
                    cr.SetParameterValue("param9", "");
                }
                else if (dtParam.Rows.Count == 3)
                {
                    cr.SetParameterValue("param1", dtParam.Rows[0].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[0].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[0].ItemArray[2].ToString());
                    cr.SetParameterValue("param2", dtParam.Rows[1].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[1].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[1].ItemArray[2].ToString());
                    cr.SetParameterValue("param3", dtParam.Rows[2].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[2].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[2].ItemArray[2].ToString());
                    cr.SetParameterValue("param4", "");
                    cr.SetParameterValue("param5", "");
                    cr.SetParameterValue("param6", "");
                    cr.SetParameterValue("param7", "");
                    cr.SetParameterValue("param8", "");
                    cr.SetParameterValue("param9", "");
                }
                else if (dtParam.Rows.Count == 4)
                {
                    cr.SetParameterValue("param1", dtParam.Rows[0].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[0].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[0].ItemArray[2].ToString());
                    cr.SetParameterValue("param2", dtParam.Rows[1].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[1].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[1].ItemArray[2].ToString());
                    cr.SetParameterValue("param3", dtParam.Rows[2].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[2].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[2].ItemArray[2].ToString());
                    cr.SetParameterValue("param4", dtParam.Rows[3].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[3].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[3].ItemArray[2].ToString());
                    cr.SetParameterValue("param5", "");
                    cr.SetParameterValue("param6", "");
                    cr.SetParameterValue("param7", "");
                    cr.SetParameterValue("param8", "");
                    cr.SetParameterValue("param9", "");
                }
                else if (dtParam.Rows.Count == 5)
                {
                    cr.SetParameterValue("param1", dtParam.Rows[0].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[0].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[0].ItemArray[2].ToString());
                    cr.SetParameterValue("param2", dtParam.Rows[1].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[1].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[1].ItemArray[2].ToString());
                    cr.SetParameterValue("param3", dtParam.Rows[2].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[2].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[2].ItemArray[2].ToString());
                    cr.SetParameterValue("param4", dtParam.Rows[3].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[3].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[3].ItemArray[2].ToString());
                    cr.SetParameterValue("param5", dtParam.Rows[4].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[4].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[4].ItemArray[2].ToString());
                    cr.SetParameterValue("param6", "");
                    cr.SetParameterValue("param7", "");
                    cr.SetParameterValue("param8", "");
                    cr.SetParameterValue("param9", "");
                }
                else if (dtParam.Rows.Count == 6)
                {
                    cr.SetParameterValue("param1", dtParam.Rows[0].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[0].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[0].ItemArray[2].ToString());
                    cr.SetParameterValue("param2", dtParam.Rows[1].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[1].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[1].ItemArray[2].ToString());
                    cr.SetParameterValue("param3", dtParam.Rows[2].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[2].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[2].ItemArray[2].ToString());
                    cr.SetParameterValue("param4", dtParam.Rows[3].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[3].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[3].ItemArray[2].ToString());
                    cr.SetParameterValue("param5", dtParam.Rows[4].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[4].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[4].ItemArray[2].ToString());
                    cr.SetParameterValue("param6", dtParam.Rows[5].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[5].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[5].ItemArray[2].ToString());
                    cr.SetParameterValue("param7", "");
                    cr.SetParameterValue("param8", "");
                    cr.SetParameterValue("param9", "");
                }
                else if (dtParam.Rows.Count == 7)
                {
                    cr.SetParameterValue("param1", dtParam.Rows[0].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[0].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[0].ItemArray[2].ToString());
                    cr.SetParameterValue("param2", dtParam.Rows[1].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[1].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[1].ItemArray[2].ToString());
                    cr.SetParameterValue("param3", dtParam.Rows[2].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[2].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[2].ItemArray[2].ToString());
                    cr.SetParameterValue("param4", dtParam.Rows[3].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[3].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[3].ItemArray[2].ToString());
                    cr.SetParameterValue("param5", dtParam.Rows[4].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[4].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[4].ItemArray[2].ToString());
                    cr.SetParameterValue("param6", dtParam.Rows[5].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[5].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[5].ItemArray[2].ToString());
                    cr.SetParameterValue("param7", dtParam.Rows[6].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[6].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[6].ItemArray[2].ToString());
                    cr.SetParameterValue("param8", "");
                    cr.SetParameterValue("param9", "");
                }
                else if (dtParam.Rows.Count == 8)
                {
                    cr.SetParameterValue("param1", dtParam.Rows[0].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[0].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[0].ItemArray[2].ToString());
                    cr.SetParameterValue("param2", dtParam.Rows[1].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[1].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[1].ItemArray[2].ToString());
                    cr.SetParameterValue("param3", dtParam.Rows[2].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[2].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[2].ItemArray[2].ToString());
                    cr.SetParameterValue("param4", dtParam.Rows[3].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[3].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[3].ItemArray[2].ToString());
                    cr.SetParameterValue("param5", dtParam.Rows[4].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[4].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[4].ItemArray[2].ToString());
                    cr.SetParameterValue("param6", dtParam.Rows[5].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[5].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[5].ItemArray[2].ToString());
                    cr.SetParameterValue("param7", dtParam.Rows[6].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[6].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[6].ItemArray[2].ToString());
                    cr.SetParameterValue("param8", dtParam.Rows[7].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[7].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[7].ItemArray[2].ToString());
                    cr.SetParameterValue("param9", "");
                }
                else if (dtParam.Rows.Count == 9)
                {
                    cr.SetParameterValue("param1", dtParam.Rows[0].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[0].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[0].ItemArray[2].ToString());
                    cr.SetParameterValue("param2", dtParam.Rows[1].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[1].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[1].ItemArray[2].ToString());
                    cr.SetParameterValue("param3", dtParam.Rows[2].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[2].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[2].ItemArray[2].ToString());
                    cr.SetParameterValue("param4", dtParam.Rows[3].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[3].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[3].ItemArray[2].ToString());
                    cr.SetParameterValue("param5", dtParam.Rows[4].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[4].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[4].ItemArray[2].ToString());
                    cr.SetParameterValue("param6", dtParam.Rows[5].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[5].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[5].ItemArray[2].ToString());
                    cr.SetParameterValue("param7", dtParam.Rows[6].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[6].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[6].ItemArray[2].ToString());
                    cr.SetParameterValue("param8", dtParam.Rows[7].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[7].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[7].ItemArray[2].ToString());
                    cr.SetParameterValue("param9", dtParam.Rows[8].ItemArray[0].ToString() + " - " + Convert.ToDecimal(dtParam.Rows[8].ItemArray[1].ToString()).ToString("#,0.00") + " : JV#" + dtParam.Rows[8].ItemArray[2].ToString());
                }
                //==================================================================================================
                //                      END HARDCODE PARAM
                //==================================================================================================

                rpt.crystalReportViewer1.ReportSource = cr;
                rpt.ShowDialog();
            }
        }