如果数据表中没有行,则抑制Crystal Reports部分 [英] Suppress Crystal Reports section if there are no rows in a datatable

查看:254
本文介绍了如果数据表中没有行,则抑制Crystal Reports部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Crystal Report中有一个部分,我想禁止。我需要抑制它,如果在我使用的数据集中的特定表中有0行。我该怎么做?提供的记录编号特殊字段似乎是报表中记录的内部计数,并且与底层数据表中的行无关。

I have a section in a Crystal Report that I want to suppress. I need to suppress it if there are 0 rows in a particular table in the dataset I am using. How would I do this? The Record Number special field provided appears to be an internal count of records in the report, and does not relate to the rows in the underlying data table.

我从C#创建报表,但我不能抑制代码段(它不适合项目结构) - 我必须能够做到从报告本身。有关的表肯定是传递到数据集中的报表,但它包含0行。必须有一个方法,在报告本身内部建立这个.....

I am creating the report from C#, but I cannot suppress the section from the code (it doesn't fit the project structure) - I must be able to do it from the report itself. The table concerned is definitely being passed to the report in the dataset, but it contains 0 rows. There must be a way to establish this inside the report itself.....

任何人都可以指出正确的方向吗?

Can anyone please point me in the right direction?

推荐答案

在Crystal Reports设计器中,查看节的属性,并且应该有一个选项Suppress,你可以给它一个公式返回适当的布尔

In the Crystal Reports designer, view the properties of your section and there should be an option to Suppress, which you can give it a formula to return the appropriate boolean value.

然后,您可以使用该公式中的Count()函数,(我相信)您可以将数据集的名称传递给Count()函数该数据集中的行数。

You could then use the Count() function within that formula and (I believe) you can pass the name of your dataset to the Count() function to get the number of rows in that dataset.

我对大约3个月前的复杂报告也做了同样的事情,但我没有访问报告已更改工作,所以我很抱歉我不能更具体,但hoepfully这给你一个起点。

I did the same thing on a complex report about 3 months ago but I don't have access to the report any more having changed jobs so I'm sorry I cannot be more specific, but hoepfully this gives you a starting point.

只是有一个快速的谷歌 - 尝试此

Just had a quick Google - try this.

这篇关于如果数据表中没有行,则抑制Crystal Reports部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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