Crystal Reports-在第一行中选择要在公式中使用的数据 [英] Crystal Reports - Selecting data in the first row to be used in a formula

查看:52
本文介绍了Crystal Reports-在第一行中选择要在公式中使用的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常基本的报告,没有分组。详细信息由许多数字列组成。我想添加一个公式字段,该字段将使用第一行中的一个字段。示例:



(ColumnAFromCurrentRecord-ColumnBFromFirstRecord)/ ColumnBFromFirstRecord



有人可以指出我正确的方向吗?

解决方案

您需要从第一条记录中提取b列。尝试以下解决方案。

 注意:这不是经过测试的解决方案,因为我目前没有CR。 

在公式 Count 下创建并详细放置部分:

 本地号码变量a; 
a:= a + 1;

这将对从 1 开始的行进行编号。 / p>

现在再创建一个公式 StoreB

  ShareVar b; 

如果{@Count} = 1
然后b:= columnb

这会将列b的值存储在变量b中的第一条记录中



现在在您想要的位置使用:

  EvaluateAfter(@StoreB)
共享编号Var b;

(ColumnAFromCurrentRecord-b)/ b

让我知道怎么回事


I have a very basic report with no groups. The details consists of a number of numeric columns. I want to add a formula field which will use a field from the first row. Example:

(ColumnAFromCurrentRecord - ColumnBFromFirstRecord) / ColumnBFromFirstRecord

Can someone point me in the right direction?

解决方案

you need to extact the column b from first record. try below solution.

Note: This is not a tested solution as I at present I don't have CR.

create below formula Count and place in detail section:

Local NumberVar a;
a:=a+1;

This will number the rows starting from 1 to the last row.

Now create one more formula StoreB:

Share NumberVar b;

if {@Count}=1
then b:=columnb

This will store the value of columnb in first record in variable b

Now use where you want:

EvaluateAfter(@StoreB)
Shared NumberVar b;

(ColumnAFromCurrentRecord - b) / b

Let me know how it goes.

这篇关于Crystal Reports-在第一行中选择要在公式中使用的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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