I am trying to build an app that converts a Crystal Report (.rpt) to PDF.
The idea is to get the .rpt filename from Business Objects, load the report and then save it as PDF, but I am getting an error when I declare the ReportDocument
Below is the code associated with crystal.....
Imports CrystalPluginMgrLib Imports CrystalEnterpriseLib Imports CrystalInfoStoreLib Imports CrystalUserPluginLib Imports CrystalObjectPackageLib Imports CrystalUserGroupPluginLib Imports CrystalDecisions Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Imports CrystalDecisions.Web Imports CrystalDecisions.ReportSource Imports CrystalDecisions.CrystalReports Dim report As New ReportDocument
The error that I get is as follows....
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in CrystalDecisions.CrystalReports.Engine.dll Additional information: Retrieving the COM class factory for component with CLSID {F734A321-8381-4FFD-A614-139E8906DC83} failed due to the following error: 80000003 One or more arguments are invalid (Exception from HRESULT: 0x80000003)
I am using Visual Studio Express 2012 and have installed the following:
- Business Objects Client
- Crystal Reports for Visual Studio 13.0.9
This is my first time working with Business Objects and Crystal Reports, so I might be missing something fundamental - any help would be much appreciated
*** UPDATE ***
The error only occurs when I create a Session using CrystalEnterpriseLib.SessionMgr and CrystalEnterpriseLib.EnterpriseSession, and log onto Business Objects.
If I don't log on to BO, the conversion works.
If I log on to BO and then log off, set both the Session and Session Manager to Nothing, then I still get the error.