private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex];



                string code = row.Cells["code"].Value.ToString();



                testdataC dss = new testdataC();
                db.cmd = new SqlCommand("select * from infoCrystal where codeDevis = @code", db.conn);
                db.cmd.Parameters.AddWithValue("@code", code);
                db.adapt = new SqlDataAdapter(db.cmd);
                db.cmd.ExecuteNonQuery();
                db.adapt.Fill(dss, "infoCrystal");
                db.cmd.Parameters.Clear();


                testCrystal3 cr = new testCrystal3();
                cr.SetDataSource(dss.Tables["infoCrystal"]);

                crystalReportViewer1.ReportSource = cr;
                crystalReportViewer1.Refresh();
            }
        }
Ejemplo n.º 2
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            testCrystal3 rpt = new testCrystal3();

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