zebeber | Bonjour à tous, j'ai installé Report viewer pour créer et voir des rapports. Ca marche très bien lorsque j'affiche un rapport (.rdlc) dans le controle ReportViewer.
Mais je voudrais créer un fichier pdf directement, sans afficher le rapport dans le contrôle. Voici mon code actuel pour le faire, mais je reçois une exception.
Code :
- LocalReport rapport = new LocalReport();
- rapport.ReportPath = @"\\la-gestion\LA-GESTION\Suivi cliches formes\Liste_cliche.rdlc";
- Warning[] warnings;
- string[] streamids;
- string mimeType;
- string encoding;
- string extension;
- byte[] bytes = rapport.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings);
- FileStream fs = new FileStream(@"C:\suivi_cliche_formes_liste_cliche.pdf", FileMode.Create);
- fs.Write(bytes, 0, bytes.Length);
- fs.Close();
|
L'exception est levée lorsqu'on passe dans la ligne "byte[] bytes = rapport......"
QQn sait me dire ce qui ne va pas?
Merci d'avance |