crystal report: Échec de la connexion
Bonjour à tous,
Je viens de faire un état et j'ai des problemes pour l'ouvrir car je n'arrive pas à me connecter à la base données, voici le code:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim myReport1 As New ReportDocument
Dim chemin1 As String = "C:\Inetpub\wwwroot\cres\Cr_DemcouvNonTermin.rpt"
Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo
'cette boucle est nécessaire pour éviter une exception
'CrystalDecisions.CrystalReports.Engine.LogOnException -> échec de la connexion
For Each tbCurrent In myReport1.Database.Tables
tliCurrent = tbCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
.ServerName = "localhost" 'spécifier le nom de votre serveur SQL Server
.UserID = "sa"
.Password = "sa"
.DatabaseName = "cres" 'nom de votre base de données
End With
tbCurrent.ApplyLogOnInfo(tliCurrent)
Next tbCurrent
Me.crpt1.ReportSource = myReport1
End Sub |
Et voici l'erreur:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
CrystalDecisions.CrystalReports.Engine.LogOnException: Échec de la connexion.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[LogOnException: Échec de la connexion.]
.F(String , EngineExceptionErrorID
) +507
.A(Int16 , Int32 ) +551
CrystalDecisions.CrystalReports.Engine.FormatEngine.GetLastPageNumber(ReportPageRequestContext reqContext) +194
CrystalDecisions.ReportSource.LocalReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext) +168
CrystalDecisions.Web.ReportAgent.get_LastPageNumber() +26
CrystalDecisions.Web.ReportAgent.u(Boolean N) +96
CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e) +99
System.Web.UI.Control.PreRenderRecursiveInternal() +77
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161 |
Merci de m'aider.