以编程方式隐藏 Crystal Report 中的文本/行 [英] Programmatically hide text/lines in a Crystal Report

查看:16
本文介绍了以编程方式隐藏 Crystal Report 中的文本/行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个水晶报表,我在使用 CrystalReportViewer.

I have a Crystal Report that I populate before displaying to the user using a CrystalReportViewer.

我有一些静态文本项和线段,我想根据业务逻辑中的条件以编程方式显示和隐藏它们.有没有办法可以将一堆这些项目组合在一起并将它们作为一个组隐藏?

I have some static text items and line segments that I would like to show and hide programatically depending on conditions in the business logic. Is there a way I can group a bunch of these items together and hide them as a group?

目前,我的另一个选择是拥有两个单独的报告,除了这些表面上的差异之外,它们都是相同的.

At the moment, my other option is to have two separate reports that are identical except for these superficial differences.

推荐答案

无论如何,请不要创建两个单独的报告:)

By all means, please don't create two separate reports :)

在报告设计视图中,您应该能够创建详细信息部分的子部分(假设您正在讨论详细信息部分),右键单击详细信息部分并选择在下面插入部分".

In the Report Design view, you should be able to create sub-sections of your detail section (assuming you're talking about the detail section), right-clicking on the Detail section and selecting "Insert Section Below".

您现在应该有详细信息 a"和详细信息 b"部分.您可以将您的文本放在详细信息 b"部分,并对其应用条件抑制公式.

You should now have "Details a" and "Details b" sections. You can put your text in the "Details b" section, and apply a conditional suppression formula to it.

要有条件地抑制详细信息 b"部分,请在设计视图"中右键单击它,选择格式化部分...",单击抑制"复选框旁边的按钮,然后在此处添加您的公式.

To conditionally suppress the "Details b" section, right-click on it in the Design View, select "Format section...", click on the button next to the "Suppress" checkbox, and add your formula there.

这篇关于以编程方式隐藏 Crystal Report 中的文本/行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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