本文介绍了DevExpress XtraReports有一个易于访问的“当前详细报告正在打印”的概念?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在打印一个详细的子报表,在整个报表上打印5次,共有5个查询结果。我用我的代码计算一些东西,所以我在我的子报表中的XRTable小部件上使用了BeforePrint事件。到目前为止这么好。

I am printing a details subreport that gets printed let's say 5 times on the overall report, for 5 query results. I compute some stuff for it with my code, and so I use BeforePrint event on an XRTable widget that I have in that subreport. So far so good.

我不喜欢的是,当BeforePrint第一次为该表执行时,我将其单元格的文本更改为某个东西,那么这将在此报告和表的所有后续实例上呈现。现在显然,由于BeforePrint再次被调用,我有机会将文本重置为应该是什么。所以这不是一个节目停止。

What I don't like is that when the BeforePrint executes for that table for the first time and I change its cells' text to something, that this renders on all subsequent instances of this report and table being printed. Now, obviously, since BeforePrint gets called again, I get the opportunity to reset the text to what it should be. So this is not a show stopper.

然而,这不知何故填满了错误。有没有办法明确地访问正在打印的表/其他小部件的实例,而不是一般的小部件,其所有实例中都会显示更改?

Yet, this somehow fills wrong, and an invitation to bugs. Is there a way for me to explicitly access "the instance of the table/other widget being printed" rather than "the widget in general, with changes being rendered in all instances that it prints"?

推荐答案

的确,你是对的。如果格式化应基于早期创建的数据或摘要,格式规则将不起作用。解决这个问题的一个可能办法是在开发人员手动浏览所有打印系统砖并手动更改其内容时,实现一种特殊的方法。你会发现一些关于如何做到这一点的例子:

Indeed, you are right. If the formatting should be based on the earlier created data or summary, formatting rules won't work. A possible solution to this problem is to implement a special approach when a developer manually browses all printing system bricks and changes their content manually. You will find some examples on how this can be done at:

这篇关于DevExpress XtraReports有一个易于访问的“当前详细报告正在打印”的概念?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 16:35