Bonjour,
Je vous explique ma situation:
pour mon projet de fin d'études j'ai envie d'afficher un exemple d'une facture dans un rapport avec des données extraite d'une base de données.
j'ai créé un dataset qui contient la table à afficher, par la suite j'ai créé mon report et enfin un webform ou le rapport pourra s'affiché.
J'ai ajouté dans la webform un crystalReportViewer.
Mais le problème c'est que ce dernier me donne aucune erreur de compilation mais dans mon webform apparait:
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69 using CrystalDecisions.CrystalReports.Engine; using CrystalDecisions.ReportSource; using CrystalDecisions.Reporting; using CrystalDecisions.Shared; using Ormval.OrmvalSystem; using System; using System.Collections.Generic; using System.Data; using System.Data.Common; using System.Data.SqlClient; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Windows.Forms; public partial class Ormval_PL_Referentiel_RedevanceP_Facture : OrmvalMain { public ReportDocument fact = new ReportDocument(); public void Page_Load(object sender, EventArgs e) { Remplir_Resource(); fact.Load("C:\\Users\\Ali AMMOR\\Downloads\\Etudes\\PFE\\Ormval Intégré\\WebApp\\CrystalReport1.rpt"); } public void Remplir_Resource() { _rm = (OrmvalRessourceManager)Application["RM"]; Button_Rechercher.Text = _rm.GetString("Button_Rechercher"); } protected override void OnInit(EventArgs e) { base.OnInit(e); } protected void Button_Rechercher_Click(object sender, EventArgs e) { try { SqlConnection connection = new SqlConnection("Data Source=.;Initial Catalog=ORMVAL;Integrated Security=True"); ds ds1 = new ds(); connection.Open(); SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM DemandeEau", connection); adapter.Fill(ds1,"DemandeEau"); fact.SetDataSource(ds1); CrystalReportViewer1.ReportSource = fact; CrystalReportViewer1.RefreshReport(); MessageBox.Show("Test"); connection.Close(); } catch (Exception exe) { MessageBox.Show(exe.ToString()); } } }
Erreur
Echec du chargement du rapport
Pour info je travaille sur:
Visual Studio 2013 Ultimate
Sql Server 2012
Crystal Report CRforVS_13_0_12
S'ils vous plait aidez moi
Partager