Salut,
Je veux imprimer un rapport sous format PDF, pour cela j'utilise localReport. Voici la partie de code :
Mon problème c'est qu'il me dit qu'il y a une exception interne dans le return et malheureusement je ne trouve pas comment corriger ça.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 public byte[] Generate(string reportPath, ReportDataSourceCollection sources, OutputFormat format) { LocalReport localReport = new LocalReport(); localReport.ReportPath = reportPath; foreach (ReportDataSource source in sources.Values) localReport.DataSources.Add(source); Warning[] warnings; string[] streamids; string mimeType; string deviceInfo = "<DeviceInfo><StartPage>0</StartPage></DeviceInfo>"; string encoding; string extension; string outFormat; switch (format) { case OutputFormat.Pdf: outFormat = "PDF"; break; case OutputFormat.Excel: outFormat = "Excel"; break; default: outFormat = "PDF"; break; } return localReport.Render( outFormat, deviceInfo, out mimeType, out encoding, out extension, out streamids, out warnings); }
Hoping to get help. Merci.
Partager