我想按 ticketCost 对报告进行排序,但是常规的总和汇总会得到所有记录的总和,包括重复记录。
I want to sort my report by ticketCost, but the regular summary of sum is got the total of all record include duplicate records.
左边的字段是摘要,右边的字段是运行总计。当我去配置组时,只有摘要出现,它只允许我选择摘要。
The left field is a Summary and the right field is a Running Total. Only the Summary shows up when I go to configure the group, it only allows me to pick the Summary.
如何对运行总计进行排序?还是有其他方法使用摘要来避免重复记录?
How can I sort on a Running Total? Or is there some other way to use a Summary to avoid duplicated records?
推荐答案水晶报表有两个阶段:阅读阶段和报告阶段。印刷阶段。在打印过程中会评估运行总计字段,但在读取过程中会进行分组。这就是为什么您无法对运行总计进行分组的原因-当分组需要时,它将无法准备就绪。
Crystal reports have two stages: the Reading stage and the Printing stage. Your Running Total fields are evaluated during Printing, but Grouping occurs during Reading. This is why you can't group on a Running Total - it won't be ready by the time Grouping needs it to be.
解决此问题的最佳方法是在数据库专家中编写自定义SQL语句。
The best way around this is to perform the calculations is to write a custom SQL statement in the Database Expert.
这将返回一个新表,您甚至可以在其中将 ticketCost 计算为一个字段那个报告。然后根据新的 ticketCost 字段进行分组。
This will return a new table in which you can calculate ticketCost as a field even before it reaches the report. Then group based on the new ticketCost field.
更多推荐
按运行总计排序
发布评论