为什么在水晶报表中使用在读取记录之前/在读取记录时/在打印记录时? [英] why use beforereadingrecords / whilereadingrecords / whileprintingrecords in crystal reports?

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

问题描述

我知道Crystal Reports呈现报告时分为三个阶段,根据阶段的不同,它可以读取静态数据或分组数据字段等,但是在这些阶段中编写公式是否有好处?

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?

推荐答案

最终结果将 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将在读取记录和之前记录按可预测,分组和排序的顺序排列。直到第二遍,而whilewhileprintingrecords通过,才对记录进行了分组和排序。这就是为什么在此过程中进行组选择。

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

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

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