示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            CrystalReport9 cr = new CrystalReport9();

            SqlConnection conn = new SqlConnection();

            conn = DBConnection.getConnection();


            string nic = textBox1.Text;

            conn.Open();
            string sql = "select * from View_6 where nic='" + nic + "'";

            DataSet        ds      = new DataSet();
            SqlDataAdapter adapter = new SqlDataAdapter(sql, conn);

            adapter.Fill(ds, "View_6");
            DataTable dt = ds.Tables["View_6"];

            cr.SetDataSource(ds.Tables["View_6"]);
            crystalReportViewer1.ReportSource = cr;
            crystalReportViewer1.Refresh();
            conn.Close();
        }
示例#2
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CrystalReport9 rpt = new CrystalReport9();

            rpt.Site = this.Site;
            return(rpt);
        }