cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports for .NET Framework 2 version 10.2 LogOnException

Former Member
0 Kudos

We are having an issue with one of our Web Applications using Crystal Reports 10.2, it sporadically stops functioning. We have Crystal Reports for .NET Framework 2 version 10.2 installed on the web server (IIS 5) where this application runs. It was coded in Visual Studio 2005 using .NET Framework 2.0.

Here is the error messageu2026

CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed. Error in File C:\DOCUME1\OMAW2K1\ASPNET\LOCALS1\Temp\BPCSExcessPF {8F3AB94B-EF83-4950-A58E-069E39C79362}.rpt: Unable to connect: incorrect log on parameters. ---> System.Runtime.InteropServices.COMException (0x8004100F): Logon failed. Error in File C:\DOCUME1\OMAW2K1\ASPNET\LOCALS1\Temp\BPCSExcessPF {8F3AB94B-EF83-4950-A58E-069E39C79362}.rpt: Unable to connect: incorrect log on parameters. at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext) at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) --- End of inner exception stack trace --- at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e) at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext) at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportOptions options) at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportFormatType formatType) at PrintFriendlyReports.PrintBPCSExcess(String fac, String part, String sort, String order) in D:\BizLoziernet\Framework2\PrintFriendlyReports.aspx.vb:line 131

Here is part of the code with Line 131u2026

Public Sub PrintBPCSExcess(ByVal fac As String, ByVal part As String, _

ByVal sort As String, ByVal order As String)

Dim Report As ReportDocument = New ReportDocument

Report.Load(Server.MapPath("Reports/BPCSExcessPF.rpt"))

Dim ReportStream As MemoryStream

Dim strCon As String = ConfigurationManager.AppSettings("ERPconStr")

Dim cn As New OleDbConnection(strCon)

cn.Open()

If cn.State = Data.ConnectionState.Open Then

Try

Dim strSQL As String

strSQL = " u2013valid sql statement u2013 u201C

Dim da As OleDbDataAdapter = New OleDbDataAdapter(strSQL, cn)

Dim ds As DataSet = New DataSet("BPCSExcessDataset")

da.TableMappings.Add("BPCSEXCESS", "BPCSEXCESS")

da.Fill(ds, "BPCSEXCESS")

Report.SetDataSource(ds)

Report.SetParameterValue("site", fac)

cn.Dispose()

LINE 131 ReportStream = Report.ExportToStream( _ CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat)

DisplayReport(ReportStream)

Catch ex As LogOnException

Response.Write("<br /><br />" & ex.ToString & "<br /><br />")

Catch ex As Exception

Response.Write("<br /><br />" & ex.ToString & "<br /><br />" & ex.Message & "<br /><br />")

Finally

If cn.State = Data.ConnectionState.Open Then

cn.Dispose()

End If

End Try

End If

End Sub

If I comment out the lines above in bold (Line 131), no errors occur so the connection and results are being returned from the database just fine. Itu2019s only when trying to reference the Crystal Libraries that it fails.

If we get this error we can change the framework on the Website from v2.0.50727 to v1.1.4322 then back to v2.0.50727 and that fixes it for a short time when suddenly it will throw this error again. This way of u201Cfixingu201D this issue is undesirable because when you change this back and forth it restarts all sites on IIS.

Here is more informationu2026

These are the libraries being reference.

CrystalDecisions.CrystalReports.Engine

CrystalDecisions.Shared

These are the assemblies.

CrystalDecisions.CrystalReports.Engine GAC 10.2.3600.0

CrystalDecisions.Enterprise.Framework GAC 10.2.3600.0

CrystalDecisions.Enterprise.InfoStore GAC 10.2.3600.0

CrystalDecisions.ReportAppServer.ClientDoc GAC 10.2.3600.0

CrystalDecisions.ReportSource GAC 10.2.3600.0

CrystalDecisions.Shared GAC 10.2.3600.0

CrystalDecisions.Web GAC 10.2.3600.0

Itu2019s almost like IIS loses visibility to the above assemblies at some point.

Also triedu2026

Weu2019ve tried manually copying the CR dlls to the bin folder on the server which doesnu2019t work on some servers but does fix the problem on other servers.

Here is one more error that is in the Windows Application Log that coincides with the erroru2026

This log has an Event ID of 1310 and the source is ASP.NET 2.0.50727.

Exception message: D:\BizLoziernet\Framework2\PrintFriendlyReports.aspx.vb(69): error BC30560: 'ReportDocument' is ambiguous in the namespace 'CrystalDecisions.CrystalReports.Engine'.

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

This sounds so strange... Framework2 -> framework 1 - framework 2 makes it work again is, well strange.

Anyhow. A few things to look at:

1) Ensure you have the latest runtime on that server:

https://smpdl.sap-ag.de/~sapidp/012002523100009351342008E/CRBasicVS2008_redist_x86.zip

2) Make sure you are closing and disposing of the report object once you are dome with it

3) The following concerns me; " Weu2019ve tried manually copying the CR dlls to the bin folder on the server which doesn't work on some servers but does fix the problem on other servers." You should never copy any Crystal Reports DLLs. Always use either the msm or msi files for deployment of the CR runtime. On this computer, it may be a good idea to do an uninstall the app, ensuring the CR runtime has been removed and reinstall. Use the CRBasicVS2008_redist_x86.zip to install the CR runtime.

Ludek

Former Member
0 Kudos

Thanks for the response. I will try these suggestions. Do you have the link for VS2005 install. The link you gave was for VS2008 and I can't find the one for 2005. Thanks.

former_member183750
Active Contributor
0 Kudos

Oops. Apologies Janice. Here is the correct link:

https://smpdl.sap-ag.de/~sapidp/012002523100006007872008E/crvs05sp1.exe

BTW., all downloads are available from this link:

https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/bobj_download/main.htm

Ludek

Answers (0)