Error loading a Crystal Report in Visual Studio 2012

I have an application in Visual Studio 2005 that I converted to Visual Studio 2012. I installed the new Service Pack for Crystal Reports. The application complies fine, but the Crystal reports wouldn't open. It says "Problem opening the report". The application log is below:

"Application: FlowSheets.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.IO.FileNotFoundException Stack: at System.Reflection.RuntimeAssembly._nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, IntPtr, Boolean, Boolean, Boolean) at System.Reflection.RuntimeAssembly.nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, IntPtr, Boolean, Boolean, Boolean) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(System.Reflection.AssemblyName, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, IntPtr, Boolean, Boolean, Boolean) at System.Reflection.RuntimeAssembly.InternalLoadFrom(System.String, System.Security.Policy.Evidence, Byte[], System.Configuration.Assemblies.AssemblyHashAlgorithm, Boolean, Boolean, System.Threading.StackCrawlMark ByRef) at System.Reflection.Assembly.LoadFrom(System.String) at CrystalDecisions.ReportAppServer.DataSetConversion.DataSetConverter.DataSetProcessingDelegate(IntPtr) "

I cannot figure out what the issue is. I can open the report in Visual Studio 2012 and edit the report. I just cannot make the report run.
Radhika VaddirajaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
Did you install the runtimes on the client?

mlmcc
Radhika VaddirajaAuthor Commented:
I installed the executable (Support Pack 15 - the first in the list). That's all. Do I also need to install the MSI64 bit msi?
Radhika VaddirajaAuthor Commented:
i meant to include the link where I downloaded the executable from. Below is the link:

http://scn.sap.com/docs/DOC-7824
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

mlmccCommented:
You do need to install the msi on the clients. or on the server if it is web-based.

mlmcc
Radhika VaddirajaAuthor Commented:
Then what am I missing? Any idea on what the error means or why I can't open the report?
mlmccCommented:
WHat code are you using to run the report?

mlmcc
Radhika VaddirajaAuthor Commented:
I finally got past the "Error loading report" part. I had to delete the Crystal Report Viewer object and add it back in the project.
But when I run the report now, the report runs but a log in box pops up. How do I set the datasource to the Crystal Reports Viewer object programatically so that I won't get the log in screen when I run the report?
mlmccCommented:
What code are you using?

mlmcc
Radhika VaddirajaAuthor Commented:
Here is the code I am using (infact the code that was put in place by another programmer who is no longer here):

This is the code for the vb page that has the Crystal Report Viewer.

Public Class OBFormRep
    Private mRecordID As String
    Private mPatientName As String
    Private mMessage As String

    Private Sub CrystalReportViewer1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim dataA As New List(Of FormAInfo)
        dataA.Add(New FormAInfo(mRecordID))
        OBReportFormA1.SetDataSource(dataA)
        Me.WindowState = FormWindowState.Maximized
        Me.Text = "Flowsheet for Patient " & mPatientName & ".  " & Message
    End Sub
    Public Property recordId() As String
        Get
            Return mRecordID
        End Get
        Set(ByVal value As String)
            mRecordID = value
        End Set
    End Property
    Public Property Message() As String
        Get
            Return mMessage
        End Get
        Set(ByVal value As String)
            mMessage = value
        End Set
    End Property
    Public Property patientName() As String
        Get
            Return mPatientName
        End Get
        Set(ByVal value As String)
            mPatientName = value
        End Set
    End Property

    Public Sub PrintReport(ByVal strRecordID As String)
        Dim dataA As New List(Of FormAInfo)
        dataA.Add(New FormAInfo(strRecordID))
        OBReportFormA1.SetDataSource(dataA)
        OBReportFormA1.PrintToPrinter(1, True, 0, 0)
    End Sub

   
End Class
mlmccCommented:
DO you set the viewer to the report anywhere?

Here is a sample for loading a report.

http://www.emoreau.com/Entries/Articles/2006/09/Feeding-Crystal-Reports-from-your-application.aspx

mlmcc

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Radhika VaddirajaAuthor Commented:
In the designer code for the VB form, I found this line of code:

Me.CrystalReportViewer1.ReportSource = "//Report.rpt"

So I copied it to the form load and pasted it. But I still get the log in ID when trying to view the report.

Attached is an image:
Untitled.png
mlmccCommented:
Was the report developed against a data source or was it always against a passed in source?

mlmcc
Radhika VaddirajaAuthor Commented:
From what I know, it has always been against a passed in source.
Radhika VaddirajaAuthor Commented:
Can anyone help please? The report worked(works) fine in Visual Studio 2005. When I converted the report to Visual Studio 2012 is when I am having problems.
mlmccCommented:
Most of the Crystal experts are just report developers.  I sent a note to one I know who has done application development.  I have done some applications but not using .Net.

mlmcc
Radhika VaddirajaAuthor Commented:
Thank you. I am also researching on other websites, but I haven't found a successful post. I posted in SAP Communite network where a developer seemed to know the issue. Waiting for his reply.
Éric MoreauSenior .Net ConsultantCommented:
Have you tried my example from the article as is before trying your own reports?
Radhika VaddirajaAuthor Commented:
@Eric,
I did try out your example and that worked. It is something about my report and how it was setup by the previous programmer. I cannot figure it out. Is there anything else to check?
Éric MoreauSenior .Net ConsultantCommented:
very hard to say without having both of my hands in your project!

are you targeting the x86 platform?
Radhika VaddirajaAuthor Commented:
Yes, I am using the x86 platform.
Éric MoreauSenior .Net ConsultantCommented:
can you find exactly the line of code throwing the error ?
Radhika VaddirajaAuthor Commented:
I am running this report from an (vb.net 2012) exe that is called from a VB6 application. I will have to set logging in the Vb.Net app to see exactly which line causes the issue. Acutally, I don't even get an error now, just pops a user and password log in.
mlmccCommented:
Was the report originally built against a database rather than a recordset?
If so it wants to log into the database before you change the source.

mlmcc
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.