DevExpress XtraReports 是否具有易于理解的“正在打印当前详细报告”的概念?
我正在打印一个详细信息子报表,假设在整个报表上打印 5 次,得到 5 个查询结果。我用代码计算了一些内容,因此我在该子报表中的 XRTable 小部件上使用 BeforePrint 事件。到目前为止,一切都很好。
我不喜欢的是,当第一次对该表执行 BeforePrint 并将其单元格的文本更改为某些内容时,这会呈现在该报表和正在打印的表的所有后续实例上。现在,显然,由于 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.
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"?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确实,你是对的。如果格式设置应基于之前创建的数据或摘要,则格式设置规则将不起作用。该问题的一个可能的解决方案是,当开发人员手动浏览所有打印系统块并手动更改其内容时,实施一种特殊的方法。您可以在以下位置找到有关如何完成此操作的一些示例:
实施页面总计
小计位于页面底部和下一页顶部
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:
Implementing Page totals
subtotal on page bottom and on next page on top