crystal-reportsnullreportsuppression

Crystal Reports: How to suppress all records in group if ONE based off the value of 1 field


I have a report which lists all employee timesheets (grouped). Each employee will have a record for each day (5 records in total) per group. I want to suppress ALL records for a employee if ANY of the 5 records has a value in a particular field (called "uniqueAttachID").

Basically, if the "uniqueAttachId" is blank, it tells me that the record does not have an attachment and I want to see all employees where this is the case. The attachment can be added to ANY of the 5 records therefore, if ANY of the records HAS data is this field, then I want the whole section of the group suppressed.


Solution

  • You can use below trick to achieve your requirement,

    1] create a summary on uniqueattachedID across the group. This summary will give you sum of uniqueattachedID column. Suppress this summary.

    2] Now go to the Section Expert of the group. Write formula for Suppress.

    3] In formula you will write

    if summary column (select this from reports field) > 0 then true 
    else false
    

    I hope this helps!