How to initiate Crystal Report from batch-session

Posted by smat-consulting on 26-Mar-2015 10:48

In 2005 PSC Netherlands created that nice crystal-integration package - it would provide exactly the functionality I need. Unfortunately, with CR 2011 it doesn't work. Can't connect to the CrystalRuntime OLE.

I don't need to view the reports, I want to initiate a generation of a report based on a predefined .rpt using some parameters that either identify the data XML or are used by CR in its query to retrieve the data for the report.

Any help greatly appreciated!

All Replies

Posted by Rob Debbage on 31-Mar-2015 02:22

Hi,

> Unfortunately, with CR 2011 it doesn't work. Can't connect to the CrystalRuntime OLE.

I'm afraid that this is expected. SAP / Business Objects deprecated and removed the Crystal COM controls from Crystal Reports 2008 onward. Unless you have an old copy of Crystal Reports 9 / 10 / XI / XI R2 laying around to install (and assuming that they'll work on current Windows releases) then old COM-based Crystal code won't work.

The alternative is to switch to use Crystal's .NET controls (assuming that you are on at least 10.2x for PROWIN32 or 11.x for _PROGRES) which should allow you to achieve the same functionality. We do not have a specific article how to call the controls in batch but the sample code attached to this article should give you a starting point:

How to override the database connection parameters within a Crystal Reports report when using .NET objects

knowledgebase.progress.com/.../000045913

Whilst the attached code does make use of the Crystal .NET Viewer, it looks like this could be stripped out leaving the sections that load the report and establish the database connection.

Kind regards,

Rob

This thread is closed