在Crystal报表的“详细信息”部分中的公式中使用运行总计 [英] Using a Running Total in a Formula in the Details Section of a Crystal Report

查看:252
本文介绍了在Crystal报表的“详细信息”部分中的公式中使用运行总计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Crystal Reports的新手,所以这可能有一个明显的答案,但是我还无法通过在互联网上搜索将两个和两个结合在一起。如果使用Crystal2008会有所不同。

I'm new to Crystal Reports so this likely has an obvious answer but I haven't been able to put two and two together yet by searching on the internet. Using Crystal2008 if that makes a difference.

我正在尝试构建一个可作为发票的报表。它需要显示按位置细分的税款。我的表在第一列中包含位置,在第二列中包含金额。我已按位置将报告分组(一个位置可以有多个记录)。我在详细信息部分中有金额。

I'm trying to build a report that will function as an invoice. It needs to display the tax broken down by Location. My table has the locations in one column and an amount in a second column. I've group the report by location (one location can have multiple records). I have the amount in the details section.

我取消了一个位置(99999),因为它是税收位置。

I've suppressed one location (99999) because it's the tax 'location'. It has an amount which is the total tax for all location.

我创建了一个运行总计,以显示每个位置的小计(#小计)(放在组页脚)。我创建了另一个运行总计,将所有金额(总计)(总计在报表页脚中)相加。我需要能够创建一个执行#Subtotal /#Total * Tax的公式来计算每个位置的税金。我想将此位置放置在组页脚中的#小计下方。但这是行不通的,因为尚未将所有金额相加。

I've created a running total to show the subtotal (#Subtotal) for each location (placed in the group footer). I've created another running total that sums all of the amounts (#Total) (placed in the report footer). I need to be able to create a formula that does #Subtotal/#Total*Tax to calculate the tax for each location. I want to place this location below the #Subtotal in the group footer. But it doesn't work because the running total hasn't added all of the amounts yet.

如果Crystal尚未读取所有记录,我该如何计算总数?

How do I calculate the total, if Crystal hasn't read through all the records yet? Is there a better way to achieve what I'm trying to do?

编辑以回答尼克的问题:
问题是运行总额尚未达到目的完成计算报告的总数。假设我有位置A,B和C。我在报表页脚中创建了一个运行总计(#Total),其中显示了A,B和C的总计。当我在组页脚中的公式中使用#Total时,

Edit to Answer Nick's Question: The issue is that the running total hasn't finish calculating the full total of the report. Let's say I have Locations A, B and C. I create a running total (#Total) in the Report Footer which displays the total for A, B and C. When I go to use #Total in the formula in the Group Footer, it has only calculated the total for A at the end of Group A.

推荐答案


  1. 创建一个称为总计的公式字段(不是正在运行的总计字段)

  2. 在公式编辑器中,抓取函数(中间分隔线)->摘要->总和-> Sum(fld)并将其放入在编辑器部分中

  3. 拖动想要总计的金额,并将其放入求和函数中

  4. 将此公式字段放入页脚(应该显示我相信的总数)

  1. Create a "Formula Field" (Not a running total field) called Total
  2. In the Formula Editor grab "Functions" (Middle divider) -> Summary -> Sum -> Sum(fld) and put it in the editor portion
  3. Drag the "Amounts" that you want the total of and and put it in the Sum function
  4. Put this formula field in the footer (It should display the total I believe you want)

这篇关于在Crystal报表的“详细信息”部分中的公式中使用运行总计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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