Exemple #1
0
        private void btnImprimer_Click(object sender, EventArgs e)
        {
            List <EtudiantsListPrint> items = new List <EtudiantsListPrint>();
            Etudiants etudiants             = etudiantsBLO.GetEtudiant();

            for (int i = 0; i < dataGridView1.Rows.Count; i++)
            {
                Etudiants p = dataGridView1.Rows[i].DataBoundItem as Etudiants;
                items.Add
                (
                    new EtudiantListPrint
                    (
                        p.Nom,
                        p.Prenom,
                        p.DateNaissance,
                        p.Contact,
                        p.Email,
                        p.Identifiant,
                        p.Sexe,
                        p.LieuxNaissance,

                        etudiants?.Nom,
                        etudiants?.Email,
                        etudiants?.Contact.ToString(),
                        etudiants?.LieuxNaissance,
                        etudiants?.Identifiant,
                        etudiants?.Prenom,
                        etudiants?.DateNaissance,
                        etudiants?.Sexe



                    )
                );
            }
            Form f = new Preview("CartePrintRpt.rdlc", items);

            f.Show();
        }