为什么在水晶报表中使用 beforereadingrecords/whilereadingrecords/whileprintingrecords? [英] why use beforereadingrecords / whilereadingrecords / whileprintingrecords in crystal reports?

查看:35
本文介绍了为什么在水晶报表中使用 beforereadingrecords/whilereadingrecords/whileprintingrecords?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道水晶报表在呈现报表时有 3 个阶段,根据阶段它可能会读取静态数据或分组数据字段等,但是在这些阶段中编写公式有什么好处吗?如果我指定阶段,最终结果应该始终相同?

I know crystal reports has 3 phases when it renders a report, and depending on the phase it may read static data or grouped data fields etc, but is there any benefit writing formulas in any of these phases? The end result should always be the same if I specify the phase or not?

推荐答案

最终结果并不总是相同的,省略评估时间函数有时会导致错误的结果.例如,假设您有一个已分组的报表,并且您正在尝试使用变量计算这些组的简单小计.假设您正在重置组标题中的变量并在页脚中显示它,同时通过以下方式在详细信息部分更新它:

The end result will not always be the same and omitting evaluation time functions can sometimes lead to incorrect results. For example, consider that you have a report that is grouped and that you are trying to calculate simple subtotals for these groups with a variable. Say you are resetting the variable in the group header and displaying it in the footer while updating it in the details section via:

numbervar subtotal;
subtotal := subtotal + {table.numericvalue}

Crystal 将在读取记录时评估此公式,并且之前记录以可预测、分组和排序的顺序进行.直到第二遍,即打印记录通过时,记录才被分组和排序.这就是为什么在此阶段中进行组选择的原因.

Crystal will evaluate this formula while reading records and before the records are in a predictable, grouped, and sorted order. It's not until the second pass, the whileprintingrecords pass, that records have been grouped and sorted. That's why group selection happens in this pass.

这只是一个例子,但有很多方法可以通过省略评估时间函数来破坏报告,主要与使用变量有关(至少我能想到).以下是有关 Crystal 多次传递的详细信息的重要资源:Crystal Reports 引擎的多次传递报告流程

This is just one example, but there are a number of ways to break a report by omitting evaluation time functions, mostly having to do with using variables (at least that I can think of). Here is a great resource for details on Crystal's multiple passes: The Multi-Pass Reporting Process of the Crystal Reports Engine

这篇关于为什么在水晶报表中使用 beforereadingrecords/whilereadingrecords/whileprintingrecords?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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