public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CrystalReport8 rpt = new CrystalReport8();

            rpt.Site = this.Site;
            return(rpt);
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            cmd = new MySqlCommand("select * from purchase_new where date>=?a and date<=?b", con);
            cmd.Parameters.AddWithValue("?a", dateTimePicker1.Text);
            cmd.Parameters.AddWithValue("?b", dateTimePicker2.Text);



            da = new MySqlDataAdapter();
            da.SelectCommand = cmd;

            DataSet ds = new DataSet();

            da.Fill(ds);

            CrystalReport8 myreport = new CrystalReport8();

            myreport.SetDataSource(ds.Tables[0]);
            crystalReportViewer1.ReportSource = myreport;
            crystalReportViewer1.Show();
        }