Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error when trying to run CRYSTAL REPORTS in ASP.NET
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00663431
Message ID:
00663504
Vues:
15
The Password is not persisted in the report for security reasons at design
time therefore you would need to pass it to the report engine at runtime:

Sample Code (VB .NET):

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared

Private report As ReportDocument = New CrystalReport1()
Private tbl As Table
Private tblLogonInfo As TableLogOnInfo
Private connInfo As ConnectionInfo = New ConnectionInfo()

connInfo.ServerName = "YOUR_SERVER"
connInfo.DatabaseName = "YOUR_DB_NAME"
connInfo.UserID = "YOUR_UID"
connInfo.Password = "YOUR_PWD"

tbl = report.DataDefinition.Tables(0) 'First table in collection
tblLogonInfo = tbl.LogOnInfo
tblLogonInfo.ConnectionInfo = connInfo
tbl.ApplyLogOnInfo(tblLogonInfo)

If you are using Windows Integrated authentication, please make sure the
ASPNET account has the sufficient rights to access the database.

If you have more than one table then you will need to set the connection information to each or them.

>I am attempting to run a report created in crystal reports in ASP.NET. I have registered and installed Crystal on my Web server as suggested. Additionally, I have added all the references to my project. When the page is requested I receive the following error:
>
>
>Logon failed.
>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
>
>Exception Details: CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.
>
>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: Logon failed.]
> .K(String 
>, EngineExceptionErrorID  ) +546
> .F(Int16 , Int32 ) +491
> CrystalDecisions.CrystalReports.Engine.FormatEngine.GetPage(PageRequestContext reqContext) +459
> CrystalDecisions.ReportSource.LocalReportSourceBase.GetPage(PageRequestContext pageReqContext) +189
> CrystalDecisions.Web.ReportAgent.v(Boolean `) +150
> CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e) +108
> System.Web.UI.Control.PreRenderRecursiveInternal() +62
> System.Web.UI.Control.PreRenderRecursiveInternal() +125
> System.Web.UI.Page.ProcessRequestMain() +1470
>
>ANY HELP IS APPRECIATED!
>Thanks in advance!
>Tim
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform