Issue with using crystal 8.5 and crystal 13 simultanously in dependent apps
I am facing some issue with different crystal versions used in applications. My application(let's say X13) is using crystal 126.96.36.1995 dotnet API and another application (let's say Y85) is using crystal 8.5 dotnet API version. My application X13 has a module which is dependent on application Y85 module and exchange information between them.
As both applications use crystal, CRPE32.dll is loaded in memory once for both the applications. The issue derives from the fact that the application X13 brings the crpe32.dll (version 188.8.131.525) located in folder “C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86” into memory. If the application X13 is not loaded into memory first then the version of crpe32.dll (i.e. 184.108.40.2061) located in the application Y85 install folder will be used.
As we know that CR 13 and CR 8.5 are two entirely different API's now without any compatibility with each other. Now if my application X13 is initialized first and crpe32.dll (version 220.127.116.115) is loaded in memory, on accessing the module dependent on application Y85, Y85 tries to make crystal calls.
It tries to call to PEOpenEngine, PEOpenPrintJob, PEGetNTables, PEGetNthTableLocation, crPEGetNthTableLogOnInfo and PEGetNDatabaseFields which executes fine but It is only the call to PEGetNthDatabaseFieldInfo that fails, with a return value of 0. Below is the sequence order of calls:
- A 2013 .NET Crystal Engine is initialized first using ReportDocument.Load method or CrystalEngine.CRPE.InitCrpe.
- Also note that calling CrystalEngine.CRPE.CloseCrpe has no positive effect of eliminating the issue.
- Subsequent calls to PEOpenEngine, PEOpenPrintJob, PEGetNTables, PEGetNthTableLocation, crPEGetNthTableLogOnInfo and PEGetNDatabaseFields all execute just fine.
- It is only the call to PEGetNthDatabaseFieldInfo that fails, with a return value of 0.
Question arises here is how to get PEGetNthDatabaseFieldInfo working when the .NET Crystal Engine has already been initialized.
- Is there a separate declare we can add to our VB6 code that will be compatible with crpe32.dll version 18.104.22.1685?
- Or can we load both crpe32.dll (version 22.214.171.1245 and 126.96.36.1991) in parallel and instruct .NET crystal to use version 13 and other one to use version 8.5 dll?
I have attached a sample code demonstrating same too. It will be great if anyone can help me on this.
Crystal versions involved : 188.8.131.525 and 184.108.40.2061
Visual Studio 2012