如果在 Crystal Reports 中重复,则用于抑制字段的公式 [英] Formula for Suppressing Field if duplicate in Crystal Reports

查看:17
本文介绍了如果在 Crystal Reports 中重复,则用于抑制字段的公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个视图,它显示水晶报表上的数据,其中我有关税、租金、股票、毛额和净额等字段.我的问题是,如果有人更改数据库中的关税,它将显示 2 行具有不同关税的相同记录从数据库的角度来看这是正常行为,但如果相同的 id 具有不同的费率或在新记录中重复租金,我想将每月租金字段抑制为 0.

I have a view which shows data on crystal reports where I have fields like tariff,rental,shares,gross and net.My problem is if someone changes the tariff in database it would show 2 rows of the same record with different tariff which is normal behavior from database point of view but I want to suppress the field of monthly rental to 0 if the same id has different tariff or the rental is repeated in new record.

ID  Tariff  Rental
1    20       390
1    15       390

如果基于 id 重复,我希望报表上的租赁"字段被禁止.目前我在水晶报表中使用此公式来检查以前的字段数据并在重复时禁止.

I want the field of Rental on reports to be suppressed if duplicates based on id.Currently I have used this formula in crystal report to check previous field data and suppress if duplicate.

{DatabaseField}=上一个({DatabaseField})

{DatabaseField}=Previous({DatabaseField})

它工作正常,但如果 id 不同并且重复租赁,那么它也会抑制我不想要的.我希望它只抑制相同的 id.

It is working fine but if the id is not same and the rental is repeated then also it will suppress which I don't want.I want it to suppress only for same id.

推荐答案

你必须将公式写入字段抑制.(如果重复则无需抑制)

You have to write the formula into field suppress. (No need on suppress if duplicated)

租赁场地{ID} = previous({ID}){rental} = previous({rental})

如果 ID 和 Rental 相同,则只有 Report 会禁止 Rental.

If ID and Rental are same then only the Report will suppress Rental.

我想这对你有用.

这篇关于如果在 Crystal Reports 中重复,则用于抑制字段的公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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