示例#1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            crIndividualSummaryNoData rpt = new crIndividualSummaryNoData();

            rpt.Site = this.Site;
            return(rpt);
        }
示例#2
0
        public void Client_Summary_Crystal()
        {
            try
            {
                MySqlCommand     cmd = new MySqlCommand();
                MySqlDataAdapter da  = new MySqlDataAdapter();
                DataSet          DS  = new DataSet();
                DataTable        DT  = new DataTable();
                Ind_Summary        = new crIndividualSummary();
                Ind_Summary_NoData = new crIndividualSummaryNoData();

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

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

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

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

                DT = DS.Tables["TABLE"];

                GlobalForms.Form1.DataTab = new DataTable();
                GlobalForms.Form1.DataTab = DS.Tables["TABLE"];

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


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