Crystal Reports:尝试在一个公式中使用另一个公式的结果。

huangapple go评论63阅读模式
英文:

Crystal Reports: Trying to use result from one formula in another formula

问题

使用Crystal V14如果需要。

在详情A行上,我尝试显示一个起始金额。

在详情B行上,需要显示一个累计总额。因此,第一个金额-$238,000应该显示从起始金额中减去的结果,然后以下金额应该显示前一个结果的金额。所以在详情B中的第一个金额应该是258,567,000,接下来的金额应该是258,329,000,依此类推。

我已经设置了3个公式。在详情A上设置一个公式,仅显示起始金额(@Notional),然后在详情B上设置两个公式:一个用于获取要从起始金额中扣除的金额(@NotionalSum),另一个用于将它们两者相加(@NotionalRunning)。

这些公式如下:

详情A

Notional

if {events.comments}='Notional' then {events.amount}

详情A的抑制条件: {@notional} <= $0.00

详情B

NotionalRunning

{@Notional}+{@notionalsum}

NotionalSum

if {events.comments} = &#39;Repay Notional&#39; then {events.amount}

详情B的抑制条件: {@notionalsum} = $0.00 or {events.comments} <> 'repay notional'

报告中的显示如下:

Crystal Reports:尝试在一个公式中使用另一个公式的结果。

Crystal Reports:尝试在一个公式中使用另一个公式的结果。

正如您所看到的,它没有按照我想要的方式计算。我发现从Notional得到的结果没有传递到NotionalRunning。我通过只将{@Notional}放入NotionalRunning公式中进行测试,结果显示为$0.00。

如果有任何帮助,将不胜感激。我尝试插入一个累计总额,但是我不太了解它们的工作原理,无法使其正常工作。我尝试的一切都失败了。

谢谢。

英文:

Using Crystal V14 if needed.

On Details A line, I am trying to show a starting amount

On Details B line, there needs to be a running total. So the first amount of -$238,000 should show the result of it being taken off the start, then the following amounts should show the amount resulting from the previous result. So the first one on Details B should be 258,567,000, then the next should be 258,329,000 and so on.

I have 3 formulas set up. One on Details A to only show the starting amount (@Notional), then two on Details B: one to grab the amounts to be taken off the starting amount (@NotionalSum), and another to add them both together (@NotionalRunning)

These are:

Details A:

Notional

if {events.comments}=&#39;Notional&#39; then {events.amount}

Suppression on Details A: {@notional} <= $0.00

Detail B:

NotionalRunning

{@Notional}+{@notionalsum}

NotionalSum

if {events.comments} = &#39;Repay Notional&#39; then {events.amount}

Suppression on Detail B: {@notionalsum} = $0.00 or {events.comments} <> 'repay notional'

How it appears in the report:

Crystal Reports:尝试在一个公式中使用另一个公式的结果。

Crystal Reports:尝试在一个公式中使用另一个公式的结果。

As you can see it is not calculating like I want it to. I have found that the result from Notional is not passing to NotionalRunning. I tested this by just putting {@Notional} into the NotionalRunning formula and it shows $0.00.

Any assistance with this would be great. I tried inserting a Running Total, but I just don't understand enough of how they work to get it to work. Everything I did try, failed.

Thanks

答案1

得分: 0

Crystal只是显示与你正在显示的详细行相关联的值,所以你不需要进行增量、总计或求和操作。

对于运行总计,一种选项是声明一个变量并将值累积到该变量中。但更简单的方法是使用内置的运行总计字段选项。右键单击该节点并设置所需的选项。

在你的情况下,在对话框的“评估”区域,你可以使用一个公式({events.comments} = 'Repay Notional')来对运行总计的评估施加条件。

不清楚你打算对Sum进行什么样的总计。但是,你可能需要从显示行级表达式转为显示实际总计。

英文:

You are not incrementing, totalling, or summing anything, so Crystal simply displays the values associated with whatever detail row you are displaying.

For the running total, one option is to declare a variable and accumulate the values into that variable. But it would be easier to simply use the built-in Running Total field option. right click that node and set the options you need.

Crystal Reports:尝试在一个公式中使用另一个公式的结果。

In your case, in the 'Evaluate' area of the dialog, you would use a formula ({events.comments} = 'Repay Notional') to impose a condition on the evaluation of the running total.

Crystal Reports:尝试在一个公式中使用另一个公式的结果。

It's not clear what you intend the Sum to total. But, again, you probably need to move from displaying a row-level expression to displaying a real total.

huangapple
  • 本文由 发表于 2023年6月19日 09:31:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/76503147.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定