I am getting error: A document processed by the JRC engine cannot be opened in the C++ stack when I try to load a Crystal Report in the Visual Studio 2012 development environment

I have seen a number of solutions to this that involved the deployed program, but I am getting this befor I publish. The report will launch from the development environment, but will cause the error when I run the program. The system crashes at rptH.Load. I am very new at integrating Crystal Reports, and any direction will be appreciated.

Here is my controller code

Imports CrystalDecisions.CrystalReports.Engine
Public Class CrystalReportsController
    Inherits System.Web.Mvc.Controller

    Public Function EmployeeQuoteLanscape() As ActionResult
        Dim rptH As New ReportClass()
        rptH.FileName = Server.MapPath("~/Content/Reprots/Quote/EmployeeQuoteLandscape.rpt")
        rptH.Load()
        rptH.SetDataSource("")
        Dim stream As IO.Stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)
        Return File(stream, "application/pdf")
    End Function
End Class

Here is a link that may help.

It is written in C#, but the solution has nothing to do with coding.

The challenge I am having, is that the error happens in the Visual Studio development enviornment. Everything I can find points to this issue happening on deployment. I am able to open the rpt file in VS, but not programatically. I keep getting the feeling I am missing something very obvious.

Just noticed that your string:

Server.MapPath("~/Content/Reprots/Quote/EmployeeQuoteLandscape.rpt")

Has a problem: Reprots

Server.MapPath("~/Content/Reports/Quote/EmployeeQuoteLandscape.rpt")

Oh my ... A very embarrassed programmer thanks you. Sigh ...

We are all human friend, and humans make mistakes.

No need to be emarrassed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.