通过RDC / ActiveX Crystal Reports XI进行独立报告预览

时间:2022-01-06 16:37:41

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

我正在使用RDC / ActiveX接口将Crystal Reports 8中的应用程序移植到Delphi 5中的Crystal Reports XI。

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

在Crystal Reports 8中,我能够为报告调出水晶报告默认报告查看器窗口,如下所示:

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:

但是,这与CR XI无关。印刷和出口我已经想到这样工作:

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?

所以我希望有人可以告诉我CR XI中是否仍然存在默认报表查看器,如果存在,如何调用它?如果没有,是否真的使用报表设计器组件创建一个?

3 个解决方案

#1


2  

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.

我最近遇到了同样的问题,并在此处描述了解决方案。我正在使用Delphi 2007,但由于代码涉及对外部ActiveX DLL的调用,它也适用于您。

#2


1  

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.

Craxddrt.dll(Crystal Reports ActiveX Designer设计和运行时库)是一个统一的对象模型,它结合了Craxdrt.dll(Crystal Reports ActiveX Designer运行时库)的运行时功能和Craxddt.dll的设计时功能(Crystal Reports) ActiveX Designer设计时间库)。 Craxddrt.dll将替换版本8.5及更高版本的Craxddt.dll。 Craxddrt.dll和Craxdrt.dll都包含在运行时创建,打开,导出,保存和打印报表所需的所有对象和关联的方法,属性和事件。此外,Craxddrt.dll在设计时设计报表时与RDC ActiveX Designer一起使用,或在运行时设计报表时与Embeddable Designer一起使用。有关更多信息,请参见第343页中的“可嵌入Crystal Reports设计器控件对象模型”。

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

注意:RDC ActiveX Designer仅在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.

在8.5版之前,Craxdrt.dll将随应用程序一起分发。现在,开发人员可以选择分发两个自动化服务器。 Craxdrt.dll与以前的版本向后兼容,并包含此版本中引入的所有功能。将Craxdrt.dll用于任何不包含Embeddable Designer的客户端应用程序,或将其用于任何服务器端应用程序。 Craxddrt.dll是单元模型线程,但不是线程安全的,只能在客户端应用程序中使用。虽然Craxddrt.dll是RDC的全功能自动化服务器,并且可以在任何客户端应用程序中工作,但它会增加安装大小。因此,建议您仅将Craxddrt.dll与可嵌入的Crystal Reports Designer控件一起使用。

#3


0  

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.)

我不能说Delphi,但在VB中我们使用的是CRViewer ActiveX Control。使用它很简单 - 您将查看器控件放在窗体上并为其分配RDC对象。这在某些地方的CR帮助中有所涉及。 (我不能看代码ATM提供工作的例子。)

#1


2  

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.

我最近遇到了同样的问题,并在此处描述了解决方案。我正在使用Delphi 2007,但由于代码涉及对外部ActiveX DLL的调用,它也适用于您。

#2


1  

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.

Craxddrt.dll(Crystal Reports ActiveX Designer设计和运行时库)是一个统一的对象模型,它结合了Craxdrt.dll(Crystal Reports ActiveX Designer运行时库)的运行时功能和Craxddt.dll的设计时功能(Crystal Reports) ActiveX Designer设计时间库)。 Craxddrt.dll将替换版本8.5及更高版本的Craxddt.dll。 Craxddrt.dll和Craxdrt.dll都包含在运行时创建,打开,导出,保存和打印报表所需的所有对象和关联的方法,属性和事件。此外,Craxddrt.dll在设计时设计报表时与RDC ActiveX Designer一起使用,或在运行时设计报表时与Embeddable Designer一起使用。有关更多信息,请参见第343页中的“可嵌入Crystal Reports设计器控件对象模型”。

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

注意:RDC ActiveX Designer仅在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.

在8.5版之前,Craxdrt.dll将随应用程序一起分发。现在,开发人员可以选择分发两个自动化服务器。 Craxdrt.dll与以前的版本向后兼容,并包含此版本中引入的所有功能。将Craxdrt.dll用于任何不包含Embeddable Designer的客户端应用程序,或将其用于任何服务器端应用程序。 Craxddrt.dll是单元模型线程,但不是线程安全的,只能在客户端应用程序中使用。虽然Craxddrt.dll是RDC的全功能自动化服务器,并且可以在任何客户端应用程序中工作,但它会增加安装大小。因此,建议您仅将Craxddrt.dll与可嵌入的Crystal Reports Designer控件一起使用。

#3


0  

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.)

我不能说Delphi,但在VB中我们使用的是CRViewer ActiveX Control。使用它很简单 - 您将查看器控件放在窗体上并为其分配RDC对象。这在某些地方的CR帮助中有所涉及。 (我不能看代码ATM提供工作的例子。)