原因是使用了模版保存了文件,事件不会被保存到模版里可以使用脚本的方式,但脚本有不安全.

这就解释了我之前的一个报表没用模版还能用这个事件, 今天在别的地方使用这个事件发现死活修改不了label值了,接这看看之前的使用也不能用了. 还纳闷问题在哪.

ello Jakub,

This is expected behavior: when an instance of the XtraReport is serialized (the report definition file is saved), it doesn't include information about assigned event handlers. In other words, the code behind of the report isn't saved. To achieve your goal, I suggest that you use Scripts, which can be serialized along with the report layout.

https://supportcenter.devexpress.com/ticket/details/t194226/xtrareports-beforeprint-don-t-work-when-run-loadlayout#

posted on 2023-02-24 17:01  小石头的一天  阅读(40)  评论(0编辑  收藏  举报