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

            rpt.Site = this.Site;
            return(rpt);
        }
Exemple #2
0
        private void fHoaDon_Load(object sender, EventArgs e)
        {
            CrystalReport2 crystal = new CrystalReport2();
            SqlConnection  connect = new SqlConnection(con);

            connect.Open();
            SqlCommand cmd = new SqlCommand("HoaDon", connect);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@id", SqlDbType.Int).Value = idBill;
            cmd.ExecuteNonQuery();
            SqlDataAdapter adapter = new SqlDataAdapter();

            adapter.SelectCommand = cmd;
            DataSet ds = new DataSet();

            adapter.Fill(ds);
            cmd.Dispose();
            connect.Close();
            crystal.SetDataSource(ds.Tables[0]);
            crp.ReportSource = crystal;
        }