Crystal Reports Runtime for VS on Windows 7 Throws an Error

46,121

Solution 1

The newest version of Crystal Reports for Visual Studio 2010 version 13.0.1 (x64) will work if the program is also run in x64 mode. This means that VS can be set to compile for Any CPU.

http://www.sdn.sap.com/irj/boc/support?rid=/webcontent/uuid/d01fdad8-44e5-2d10-61ad-9d2d4158f3a8

Solution 2

first change your platform target of your project as x86 then compile again and install this setup in your windows 7 64 bit pc (C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\CrystalReports\CRRedist2005_x86.msi) and try to open your reports.

Solution 3

We fixed this issue by setting the application pool advanced setting Enable 32-Bit Applications to true

Share:
46,121
AndyD273
Author by

AndyD273

Here for the programming and world building.

Updated on March 18, 2020

Comments

  • AndyD273
    AndyD273 about 4 years

    It seems to be working fine on my development machine, or the Windows XP test machines, but I'm running into problems on the Windows 7 test machines.

    enter image description here

    After that, I get a normal crash error:

    ************** Exception Text **************
    System.InvalidOperationException: An error occurred creating the form. See
    Exception.InnerException for details.  The error is: The type initializer for
    'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. ---> 
    System.TypeInitializationException: The type initializer for 
    'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. ---> 
    CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: An error has occurred while 
    attempting to load the Crystal Reports runtime.
    
    Either the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.
    
    Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required.  Please go to http://www.businessobjects.com/support for more information.
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.CheckForCrystalReportsRuntime()
       at CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor()
       --- End of inner exception stack trace ---
       at CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor()
       at CrystalDecisions.CrystalReports.Engine.ReportClass..ctor()
       at Processing.LogTag..ctor()
       at Processing.frmPrint.InitializeComponent()
       at Processing.frmPrint..ctor()
       --- End of inner exception stack trace ---
    

    Their website is of course a nightmare to find anything...

    Note: It is Windows 7 64bit, but I'm already running the program in 32bit mode.

    Update:

    So I figured out that crystal reports has an issue where the x64 version doesn't have any initializers, and so trying to initialize it in my program is causing an error.
    I have verified that if I uninstall the x64 version, and install the x86 32bit version, the program works fine. I've read that some people had sucess just running the program in 32bit mode, but for whatever reason that didn't work for me.

    I'm leaving the question open for a little bit, in hopes that someone has figured out how to get it to initialize the 64 bit version, because that's what automatically installs from the click once setup.

  • Shamim Hafiz - MSFT
    Shamim Hafiz - MSFT almost 12 years
    If I install the 64 bit version, will this work with older PC ?
  • AndyD273
    AndyD273 almost 12 years
    If I'm not mistaken, If you install that version and compile it on a 64bit computer, then it'll work on either x86 or x64 computers. At least it did for me. You may have to play around with the build settings some, but it should work.
  • Rocky Andra
    Rocky Andra about 10 years
    That's Great Man!. You save the day
  • koo9
    koo9 over 9 years
    This is a life saver. When creating a windows service in VS, it seems to like to build for 32bit OS, so clearing the check on "prefer 31 bit" do the trick.