The essential details here are as follows:
- Windows Server 2008 64bit
- Python26 64bit
- Visual Studio 2008(Team) which installs Crystal Reports (both 32bit and 64bit runtimes)
My problem is the following code fails when Dispatch('CrystalRuntime.Application') is called, this worked fine on same 32bit OS configuration of the above.
The error being:
(-2147221164, 'Class not registered', None, None)
I've spent hours going through various reason why this is failing and I've got nowhere..
I've even run makepy.py on the 'Crystal Reports ActiveX Designer Run Time Library' which contains the com interface I'm trying to create, but even this fails to deliver a result.
I know crystal is installed correctly as it works perfectly well and I can see the com classes registered correctly.
I completely stuck and need help, as always i hope stack can come to my rescue again...
Any thoughts, please bear in mind i'm not a python programmer of any magnitude...
import os
import sys
import re
import time
from win32com.client import Dispatch
import pythoncom
def main():
try:
app = Dispatch('CrystalRuntime.Application')
print app
except pythoncom.com_error, e:
print "(crystal reports not installed?): '%s'" % e
return 0
print 'Success!!!'
if __name__ == '__main__':
main()