Exemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            crDepMasterW_ONameNoData rpt = new crDepMasterW_ONameNoData();

            rpt.Site = this.Site;
            return(rpt);
        }
Exemplo n.º 2
0
        public void Dep_Master_W_O_Name()
        {
            try
            {
                MySqlCommand     cmd = new MySqlCommand();
                MySqlDataAdapter da  = new MySqlDataAdapter();
                DataSet          DS  = new DataSet();
                DataTable        DT  = new DataTable();
                Dep_MasterW_OName        = new crDepMasterW_OName();
                Dep_MasterW_OName_NoData = new crDepMasterW_ONameNoData();

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

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

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

                cmd             = new MySqlCommand("sp_dav_Dep_Master_WO_Dep_Name", 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)
                {
                    Dep_MasterW_OName_NoData.SetDataSource(DS.Tables[0]);
                    GlobalVariable.MyADOConnection.Close();
                    crViewer.ReportSource = Dep_MasterW_OName_NoData;
                }
                else
                {
                    Dep_MasterW_OName.SetDataSource(DS.Tables[0]);
                    GlobalVariable.MyADOConnection.Close();
                    crViewer.ReportSource = Dep_MasterW_OName;
                }

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