CrystalDecisions.Web reference version changes suddenly when run the webapp

Posted by Somebody on Stack Overflow See other posts from Stack Overflow or by Somebody
Published on 2012-12-18T21:01:33Z Indexed on 2012/12/18 23:03 UTC
Read the original article Hit count: 324

Filed under:
|

I'm breaking my head with this issue, I have a webapp that has a report using crystal report, in the development pc it works fine, but when copy the same project to another pc, when I load the project (VS 2003) the following msg appears:

One or more projects in solution need to be updated to use Crystal Reports XI Release 2. If you choose "Yes", the update will be applied permanently...

I choose "Yes" and after that I can see that CrystalDecisions.Web reference has the correct version, and location according to the develpment machine, in this case: 11.5.3300.0.

But when run the webapp, I can see when the version and path suddenly changes to: 11.0.3300.0.

And when trying to see the report the following error appears:

Parser Error Message: The base class includes the field 'CrystalReportViewer1', but its type (CrystalDecisions.Web.CrystalReportViewer) is not compatible with the type of control (CrystalDecisions.Web.CrystalReportViewer).

the asp.net has the following:

<%@ Register TagPrefix="cr" Namespace="CrystalDecisions.Web" Assembly="CrystalDecisions.Web, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" %>

How is this possible? what's happening here?

EDIT This is what I did:

the wrong version (11.0.3300.0) was located at: C:\Program Files\Common Files\Business Objects\3.0\managed

and the right version (11.5.3300.0) is located at: C:\Program Files\Business Objects\Common\3.5\managed

So I just deleted the files of the wrong solution, and I made it work in my new computer, no more errors when running the webapp, the report shows fine.

But when try to do the same thing in production server, a different error came out, now an exception:

This report could not be loaded due to the following issue: The type initializer for 'CrystalDecisions.CristalReports.Engine.ReportDocument' threw an exception.

Any idea what could be causing this error now?

Here is the code:

Try
            Dim cr As New ReportDocument
            cr.Load(strpath)
            cr.SetDatabaseLogon("usring", "pwding")
            Select Case rt
                Case 1
                    cr.SummaryInfo.ReportTitle = "RMA Ticket"
                Case 2
                    cr.SummaryInfo.ReportTitle = "Service Ticket"
            End Select
            'cr.SummaryInfo.ReportTitle = tt
            cr.SetParameterValue("TicketNo", tn)
            'cr.SummaryInfo.ReportComments = comment
            CrystalReportViewer1.PrintMode = CrystalDecisions.Web.PrintMode.ActiveX
            CrystalReportViewer1.ReportSource = cr
            CrystalReportViewer1.ShowFirstPage()
            'cr.Close()
            'cr.Dispose()
        Catch ex As Exception
            MsgBox1.alert("This report could not be loaded due to the following issue: " & ex.Message)
        End Try

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about crystal-reports