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

            rpt.Site = this.Site;
            return(rpt);
        }
示例#2
0
        private void Form26_Load(object sender, EventArgs e)
        {
            con = new MySqlConnection("server=localhost;username=root;pwd=niku2912;database=canteen");
            con.Open();
            cmd = new MySqlCommand("select prod_code from purchase where purchase.prod_code=raw_material.prod_code and purchase.prod_code=packing_product.prod_code ", con);

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

            DataSet ds = new DataSet();

            da.Fill(ds, "prod_code");

            CrystalReport2 myreport = new CrystalReport2();

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