示例#1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            SubReportDecisionCrystalReport rpt = new SubReportDecisionCrystalReport();

            rpt.Site = this.Site;
            return(rpt);
        }
示例#2
0
        private void crystalReportViewer1_Load(object sender, EventArgs e)
        {
            try
            {
                if (cn.State == ConnectionState.Closed)
                {
                    cn.Open();
                }
                cmd = new SqlCommand("select id_plainte,date_creation,signe_plainte,type_plainte from plainte where id_plainte like '" + id_plainte + "'", cn);
                da  = new SqlDataAdapter(cmd);
                da.Fill(ds, "plainte");

                cmd1 = new SqlCommand("select top(1) * from avocat", cn);
                da1  = new SqlDataAdapter(cmd1);
                da1.Fill(ds, "avocat");


                cmd2 = new SqlCommand("select plaignant.* from plaignant,plainte where plainte.id_plainte like '" + id_plainte + "' and plainte.id_plaignant=plaignant.id_plaignant", cn);
                da2  = new SqlDataAdapter(cmd2);
                da2.Fill(ds, "plaignant");

                cmd3 = new SqlCommand("select par_plaignant.* from par_plaignant,plainte,plainte_par_plaignant where plainte.id_plainte like '" + id_plainte + "' and plainte_par_plaignant.id_plainte=plainte.id_plainte and plainte_par_plaignant.id_par_plaignant=par_plaignant.id_par_plaignant", cn);
                da3  = new SqlDataAdapter(cmd3);
                da3.Fill(ds, "par_plaignant");

                cmd4 = new SqlCommand("select * from decision_plainte where id_plainte like '" + id_plainte + "'", cn);
                da4  = new SqlDataAdapter(cmd4);
                da4.Fill(ds1, "decision_plainte");

                SubReportDecisionCrystalReport s = new SubReportDecisionCrystalReport();
                s.SetDataSource(ds1);

                PrintOnePlainteCrystalReport i = new PrintOnePlainteCrystalReport();

                i.SetDataSource(ds);
                i.Subreports["SubReportDecisionCrystalReport.rpt"].SetDataSource(ds1);
                i.OpenSubreport("SubReportDecisionCrystalReport.rpt");
                i.Refresh();

                crystalReportViewer1.ReportSource = i;
                crystalReportViewer1.Refresh();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.StackTrace);
            }
        }