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

            rpt.Site = this.Site;
            return(rpt);
        }
Пример #2
0
        private void LoadReport()
        {
            if (ImplementeConnexion.Instance.Conn.State != ConnectionState.Open)
            {
                ImplementeConnexion.Instance.Conn.Open();
            }

            using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
            {
                cmd.CommandText = @"select personne.id as Code,personne.nom + ' ' + ISNULL(personne.postnom,'') + ' ' + ISNULL(personne.prenom,'') as Nom,
                personne.sexe as Sexe,telephone.initial + '' + telephone.numero as 'Tél.' from personne
                left outer join telephone on personne.id=telephone.id_personne order by Nom asc ";

                SqlDataAdapter adapter = new SqlDataAdapter((SqlCommand)cmd);
                DataSet        dataset = new DataSet();
                adapter.Fill(dataset, "lstPersonne");

                ListePersonne rpt = new ListePersonne();
                rpt.SetDataSource(dataset.Tables["lstPersonne"]);
                crvRapport.ReportSource = rpt;
                crvRapport.Refresh();

                dataset.Dispose();
            }
        }