Example #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            crDepositTypeSummary rpt = new crDepositTypeSummary();

            rpt.Site = this.Site;
            return(rpt);
        }
Example #2
0
        public void Deposits_Type()
        {
            try
            {
                MySqlCommand     cmd = new MySqlCommand();
                MySqlDataAdapter da  = new MySqlDataAdapter();
                DataSet          DS  = new DataSet();
                DataTable        DT  = new DataTable();
                Deposit_Type_Summary = new crDepositTypeSummary();
                //TopDepositor = new crTopDepositor();
                //TopDepositor_NoData = new crTopDepositorNoData();

                GlobalVariable.MyADOConnection = new MySqlConnection(GlobalVariable.dbConnectionString);
                GlobalVariable.MyADOConnection.Open();

                //MySQLQuery = "";
                //MySQLQuery = "call sp_Top_Depositor ('" + GlobalVariable.Date_ + "'); ";

                //MySqlCommand cmd = new MySqlCommand(MySQLQuery, GlobalVariable.MyADOConnection);
                //cmd.ExecuteScalar();

                cmd             = new MySqlCommand("sp_DAV_Deposit_Type_Summary", GlobalVariable.MyADOConnection);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("Date_", GlobalVariable.Date_);
                cmd.CommandTimeout = 0;
                da.SelectCommand   = cmd;
                da.Fill(DS, "TABLE");

                if (DS.Tables[0].Rows.Count == 0)
                {
                    //TopDepositor_NoData.SetDataSource(DS.Tables[0]);
                    //GlobalVariable.MyADOConnection.Close();
                    //crViewer.ReportSource = TopDepositor_NoData;
                }
                else
                {
                    Deposit_Type_Summary.SetDataSource(DS.Tables[0]);
                    GlobalVariable.MyADOConnection.Close();
                    crViewer.ReportSource = Deposit_Type_Summary;
                }

                frmReports rep = new frmReports();
                rep.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }