Link to home
Start Free TrialLog in
Avatar of kaljess
kaljess

asked on

previewing report using RDC in crystal reports 9

Hello,
Al trying to automate crystal reports using Microsoft vc++.My application works perfect with old versions of crystal report.But With the version 9 i have a problem in previewing the report.
I studied that the  crystal report version 9 comes with a new automation server Craxdrt9.dll instead of CPEAUT32.dll.
Inorder to upgrade my application i had to find out the new dispatch IDS of the “CrystalRuntime.Application” automation server.
I got the  Dispatch Ids of all the methods by opening the CRAXDRT.TLB file in OLE/COM object viewer.

But i am unable to get the dispath ID of the preview function which was working perfectly with the old automation server.Can anybody give an expert advice on this.AM STUCK:(
Thanks in advance
Avatar of Mike McCracken
Mike McCracken

Did you try using the old method with CR9?  I was under the impression that the automation engine was still there.

What code are you using?

Take a look at

http://support.crystaldecisions.com/communityCS/FilesAndUpdates/rdccpp85.exe.asp

mlmcc
Avatar of kaljess

ASKER

I did some Research on it and found
The crystal report version 9 does not have a Report Engine Automation Server component unlike its previous versions. It has Report Development Component and Crystal Reports Viewers for the same purpose.
The only way to upgrade crystal reports to version 9.0 is to migrate from Report Engine Automation Server component suite to those of the Crystal RDC (Report Development Component).

For reference see
http://support.crystaldecisions.com/library/kbase/articles/c2003667.asp
http://www.hammerapps.com/techtips/techtipsasp/techtipsdynamic.asp?TTID=77



Changes to be made to migrate to crsytal report 9.0(vc++ environment)


The new Crystal reports Report Development Component“CrystalRuntime.Application” (Craxdrt9.dll) has to be used instead of  “Crystal.CRPE.Application”
(CPEAUT32.dll) for automating crystal reports from CIS

To accomplish this Modify Initialize () function in Qcrystal.rpt

BSTR b = T2BSTR ("Crystal.CRPE.Application");

to

BSTR b = T2BSTR ("CrystalRuntime.Application");



Get exact Dispatch ID’s of  Report Development Component
“CrystalRuntime.Application”

Dispatch ID’s are used to access exposed automation server’s objects and also to invoke their methods.

An analysis revealed that the Dispatch ID’s of Craxdrt9.dll (version 9) and CPEAUT32.DLL (old version) differs making the automation process for crystal reports version 9.0 fail in CIS.

Dispatch Ids can be obtained by opening the CRAXDRT.TLB file in OLE/COM object viewer.

Also to retrieve the descriptions of objects, collections, methods, and properties of Report design automation object download
http://support.crystaldecisions.com/communityCS/TechnicalPapers/rdc8_browser.exe.asp

The Dispatch Ids can also be retrieved using the GetIDsOfNames () function.

EG.

InvokeHelper (0x5, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, parms, ReportFileName);

to

InvokeHelper (0x120, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, parms, ReportFileName);

Replace all the old dispatch IDs with new dispatch IDs

Thanks
jess
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial