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

            rpt.Site = this.Site;
            return(rpt);
        }
Ejemplo n.º 2
0
        public void Client_Individual_Crystal()
        {
            try
            {
                MySqlCommand     cmd = new MySqlCommand();
                MySqlDataAdapter da  = new MySqlDataAdapter();
                DataSet          DS  = new DataSet();
                DataTable        DT  = new DataTable();
                Individual        = new crIndividual();
                Individual_NoData = new crIndividualNoData();

                GlobalVariable.MyADOConnection = new MySqlConnection(GlobalVariable.dbConnectionString);
                GlobalVariable.MyADOConnection.Open();
                string DateHold = GlobalVariable.Date_;
                //MySQLQuery = "";
                //MySQLQuery = "call Client_Individual ('" + DateHold + "'); ";

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

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

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

                DT = DS.Tables["TABLE"];

                //GlobalForms.Form1.CreateCSVFile(DT, "d:\\Depositor_Report.csv");


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