Print Page | Close Window

Conditional Suppress-Sections

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=20878
Printed Date: 28 Apr 2024 at 9:39am


Topic: Conditional Suppress-Sections
Posted By: brosbury
Subject: Conditional Suppress-Sections
Date Posted: 10 Jul 2014 at 7:46am
My report is designed to highlight changed fields for patient records.  Each patient record has a recorded change date and there are between 1 and 20 records per patient.  I have grouped the report by patient number and worked out logic to highlight the desired field changes in the group footer.
 
I wish to only show the records for a certain change date and operator.  Note:  There are different operators for each change date.
 
My logic was to use conditional suppression on the details section, which shows some basic operator and patient fields.  Specifically, to show records for a 6/27/2014 change date and operator 237178, my conditional formula in the Section Expert -Details section is: (CDate({vwGenPatChangeInfo.DateTime_Changed}) <> Date (2014, 6, 27)) and {vwGenPatChangeInfo.Operator_Abbr} <> "237178"
 
The result is not what is desired.  I see 1) Records for the operator (regardless of date), 2) Records for the Date (regardless of the operator) in addition to the correct records( 6/27 date and operator 237178).
 
What is wrong with my formula?  Is there a better way to do this?
 



Replies:
Posted By: DBlank
Date Posted: 10 Jul 2014 at 8:31am
I am not seeing anything wrong
you can write two seperate formula to test each part against the detail section to see where the evaluation is not acting like you expected
test1
CDate({vwGenPatChangeInfo.DateTime_Changed}) <> Date (2014, 6, 27)
 
test2
{vwGenPatChangeInfo.Operator_Abbr} <> "237178"
place both on the detail section and you will see True and False values
(remove your suppression condition for now to get a full picture)
 
look at the rows where it is returning a value you did not expect and look for a pattern
 
you an also change it to
NOT (CDate({vwGenPatChangeInfo.DateTime_Changed}) = Date (2014, 6, 27) and {vwGenPatChangeInfo.Operator_Abbr} = "237178")
but it likely will have the same core issue as your version
 



Print Page | Close Window