在XtraReport中以编程方式将标题设置为查看器表单 [英] Set programatically the title to the viewer form in XtraReport

查看:254
本文介绍了在XtraReport中以编程方式将标题设置为查看器表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在显示XtraReport文档时,有没有人知道如何设置表单查看器的标题?
该方案如下:

Does anybody know how to set the title to the form viewer when showing an XtraReport document? The scenario is the following:

我已经配置了一个XtraReport报告,我显示它调用ShowPreviewDialog方法,打开查看器表单并显示文档。我需要设置这个查看器表单的标题,找不到属性或方式来完成此操作。

I have an XtraReport report configured, I show it calling the ShowPreviewDialog method, a viewer form opens and shows the document. I need to set the title to this viewer form and can't find the property or way to accomplish this.

提前感谢。

推荐答案

我不相信XtraReport对象使用的预览表单以这样一种方式可以简单地设置标题。但是,可以创建您自己的预览表单。这将使您最终控制预览的显示方式。不幸的是,使用这种方法需要您以不同的方式调用预览。你不会再调用myReport.ShowPreviewDialog()。在该示例中,报表是在表单的加载事件中创建的预览表单的私有成员。但是,在加载之前,我会将现有报表对象的引用传递给表单,以便您可以重新使用一个打印预览表单。

I don't believe that the preview form used by the XtraReport object is exposed in such a way that you could simply set the title. However, it is possible to create your own preview form. That would give you ultimate control over how your preview is displayed. Unfortunately, using that approach requires you to invoke the preview differently. You would no longer call myReport.ShowPreviewDialog(). In the example, the report is a private member of the preview form that is created in the form's load event. But I would pass a reference to an existing report object into the form before it loads so you can re-use one print preview form.

这篇关于在XtraReport中以编程方式将标题设置为查看器表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆