简体   繁体   English

Crystal Reports会抑制子报表上的问题

[英]Crystal Reports suppress issue on Sub Reports

Why do certain columns of a sub report not suppress with the same code put in some other columns. 为什么子报表的某些列不会使用其他列中的相同代码进行抑制。 The other columns suppress successfully, just the header does not suppress. 其他列成功抑制,只是标题不抑制。

I have already tried suppressing within the sub report. 我已经尝试在子报告中进行抑制。 When I try to suppress the entire sub report section, the entire report does not show any data. 当我尝试取消整个子报表部分时,整个报表不显示任何数据。

If isNull({CTA_Detail_3.PROJECT_NUM}) THEN TRUE
Else If 
    totext({CTA_Detail_3.PROJECT_NUM}) <> totext({?Pm-CTA_Head.PROJECT_NUM}) OR
    totext({CTA_Detail_3.PROJECT_PURPOSE}) <> totext({?Pm-CTA_Head.PROJECT_PURPOSE}) OR
    totext({CTA_Detail_3.PROJECT_TIRE_NO}) <> totext({?Pm-CTA_Head.PROJECT_TIRE_NO}) OR
    totext({CTA_Detail_3.EXAM_DATE_CUT}) <> totext({?Pm-CTA_Head.EXAM_DATE_CUT}) Then TRUE

The sub report should not show up if CTA_DETAIL_3.PROJECT_NUM is NULL 如果CTA_DETAIL_3.PROJECT_NUM为NULL,则不应显示子报告

Try placing the fields being evaluated in your suppress formula within the sections where they are not working as expected. 尝试将正在评估的字段放置在它们未按预期工作的部分中的抑制公式中。 The problem is most likely that they do not yet contain the values necessary for the formula to evaluate to True. 问题很可能是它们尚未包含公式评估为True所需的值。

In the first line of the formula you provided, you are testing for a NULL value. 在您提供的公式的第一行中,您正在测试NULL值。 It could be parsing this field as an empty string instead of a NULL, so you may want to test for that condition as well by modifying the formula as follows: 它可以将此字段解析为空字符串而不是NULL,因此您可能希望通过修改公式来测试该条件,如下所示:

If isNull({CTA_Detail_3.PROJECT_NUM}) Or {CTA_Detail_3.PROJECT_NUM} = "" THEN TRUE

I try to be in the habit of always testing for null values by also testing for empty strings as this helps ensure both scenarios are handled by the formula. 我试图通过测试空字符串来始终测试空值,因为这有助于确保公式处理这两种情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM