条件打印取决于Crystal Reports中的空值或空值 [英] Conditional printing depending of empty or null value in Crystal Reports

查看:163
本文介绍了条件打印取决于Crystal Reports中的空值或空值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个StoredProcedure,它返回一个对应于具有列Name和Surname的表的唯一行。



我希望报告显示: / p>

 名称:NameField 
姓氏:SurnameField

其中NameField和SurnameField是StoredProcedure返回的字段。



特殊要求是如果SurnameField为空或为空,那么我不想显示Surname:SurnameField。



如何实现?
我唯一想到的是打破storageprocedure两个,一个为名称和一个为Surname,并划分每个行在不同的子报表,并选择删除如果空(或类似的)第二个。 。但是这真的太过分了,我想有一个更简单的方法。

解决方案

应该有很多方法来实现。我不太确定你的报告如何布局,但你可以使用一个简单的公式来压制字段和标签或整个部分(如果它有自己的) isnull({table.field})或{table.field} =''



null可以被视为默认而不是例外你可以简单地做: {table.field} =''



L


Suppose I have an StoredProcedure that returns a unique row corresponding to a table with columns "Name" and "Surname".

I want the report to show:

Name: NameField
Surname: SurnameField

Where the "NameField" and "SurnameField" are the fields returned by the StoredProcedure.

The special requirement, is that if "SurnameField" is empty or null, then I don't want to show the "Surname: SurnameField".

How can I achieve this? The only thing that I thought is breaking the storedprocedure in two, one for Name and one for Surname, and dividing each line in different subreports and selecting "Delete if empty" (or something like that) for the second... but this is really overkill, I guess there's an easier way.

解决方案

Should be quite a few ways of achieving this. I'm not quite sure how your report is laid out but you can surpress the field and label or entire section (if it has it's own) using a simple formula; isnull({table.field}) or {table.field} = ''

Or if you have set nulls to be treated as defaults rather than exceptions you can simply do: {table.field} = ''

L

这篇关于条件打印取决于Crystal Reports中的空值或空值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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