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

            rpt.Site = this.Site;
            return(rpt);
        }
Beispiel #2
0
        private void Form29_Load(object sender, EventArgs e)
        {
            con = new MySqlConnection("server=localhost;username=root;pwd=niku2912;database=canteen");
            con.Open();
            cmd = new MySqlCommand("select * from stock", con);

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

            DataSet ds = new DataSet();

            da.Fill(ds, "tot_qty");

            CrystalReport6 myreport = new CrystalReport6();

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