views:

3399

answers:

4

I'm porting an application from Crystal Reports 8 to Crystal Reports XI in Delphi 5, using the RDC/ActiveX interface.

In Crystal Reports 8, I was able to bring up the crystal reports default report viewer window for a report like so:

RptInvoicing.Destination := 0; // To: window
RptInvoicing.Action := 1; // Execute

However, this does not fly with CR XI. Printing and exporting I've figured out to work like this:

crReport.PrintOut(True);
...
crReport.Export(True);

But I haven't been able to find anything relevant to show the default preview window. I've tried implementing my own using the report viewer component, but it has a lot of problems like locking up when resizing, freezing and crashes, so it's not a viable solution for a production app.

Even the official support forums weren't of help, I only got a nasty answer to go look at the manuals, which I've been through several times and can only refer to as bad. It's not every day you see such bad documentation for an enterprise product. I found nothing relevant to this in their manuals, so I'm led to think their own staff have no idea about this either.

So I'm hoping someone here could tell me if the default report viewer still exists in CR XI, and if it does, how to invoke it? If it doesn't, is using the report designer component really the only solution to create one?

A: 

I can't say anything about Delphi, but in VB we are using CRViewer ActiveX Control. Using it is straightforward - you put viewer control on form and assign RDC object to it. This is covered in CR help somewhere. (I can't look at code ATM to provide working exmples.)

Arvo
Yes, I've tried using the component, but find it both unstable and slow!
psoul
A: 

From their documentation:

Craxddrt.dll (Crystal Reports ActiveX Designer Design and Runtime Library) is a unified object model that combines the runtime capabilities of the Craxdrt.dll (Crystal Reports ActiveX Designer Run Time Library) with the design time capabilities of the Craxddt.dll (Crystal Reports ActiveX Designer Design Time Library). Craxddrt.dll will replace Craxddt.dll for versions 8.5 and up. Both the Craxddrt.dll and the Craxdrt.dll contain all the objects and associated methods, properties, and events needed for creating, opening, exporting, saving, and printing a report at run time. In addition, Craxddrt.dll is either used with the RDC ActiveX Designer when designing reports at design time, or used with the Embeddable Designer when designing reports at run time. See “Embeddable Crystal Reports Designer Control Object Model” on page 343 for more information.

Note: The RDC ActiveX Designer is only available in Microsoft Visual Basic.

Prior to version 8.5, the Craxdrt.dll would be distributed with an application. Now the developer has a choice of two automation servers to distribute. Craxdrt.dll is backwards-compatible with previous versions and contains all the features introduced in this version. Use the Craxdrt.dll for any client-side application that does not contain the Embeddable Designer, or use it for any server-side application. Craxddrt.dll is apartment-model threaded, but is not thread safe, and can only be used in a client-side application. Although the Craxddrt.dll is a fully functional automation server for the RDC, and can work in any client-side application, it will increase the install size. Therefore, it is recommended that you only use Craxddrt.dll with the Embeddable Crystal Reports Designer Control.

GregD
+2  A: 

I recently had the same problem, and described the solution here. I am using Delphi 2007, but since the code involves calls to an external ActiveX DLL, it should work for you too.

JosephStyons
A: 

Hi!

Have you been successfull with your port to crystal XI with delphi 5? I'm in the same position and have/had some big problems and am eager to know who else did it?

At the moment my problem is that although I can set all parameters of a report by code the preview with the ActiveXReportViewer only shows an empty report (take a look at this).

Any help greatly appreciated!

Reinhard

pastacool