Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Field Suppression Bizarre behaviour Post Reply Post New Topic
Author Message
TrevorBradley
Newbie
Newbie


Joined: 16 Aug 2013
Location: Canada
Online Status: Offline
Posts: 4
Quote TrevorBradley Replybullet Topic: Field Suppression Bizarre behaviour
    Posted: 16 Aug 2013 at 11:28am
I'm a bit new a this so hopefully I'm making a simple mistake and not going nuts.

First of all, I'm using Crystal Reports 2011.  I'm trying to modify reports from the Epicor application, but for the purposes of my testing, I'm starting with blank reports and inserting fields after setting up groups.

I'm having really strange behaviour with suppression. For reference, my test case has 2 lines of data.

I can get duplicate fields in subsequent lines to supress by doing the following:

1) In Format Field > Common Tab > Suppress (Formula Icon) setting the formula value to: {PODetail.Company} = Previous({PODetail.Company})
2) Leaving the Suppress checkbox *UNSELECTED*.

Supression of the second field then works as I'd hope.

If I check the Suppress checkbox, the field is supressed for BOTH lines.

If I change the forumla to TRUE, but leave the checkbox unselected, both fields are supressed.

The Suppress if Duplicated checkbox and formula appear to do absolutely nothing (even if Formula is set to TRUE or FALSE).

There's similar behaviour in the Section Expert - If I want to supress the entire line I need to leave the Suppress checkbox unchecked.

This seems like sheer madness to me.  Can someone verify this is abnormal behaviour?  Shouldn't the forumla be ignored if the checkbox is left unchecked?

I've got a wild theory as to why this might be, but I want to make sure I'm not missing something obvious before reinstalling Crystal Reports from scratch.

Also, a follow up question.  If Suppress takes in a formula, that can use the Previous function, what exactly is the difference between "Suppress" and "Suppress If Duplicated"? (Or am I being confused by previous abnormal behaviour?)





IP IP Logged
iSing
Newbie
Newbie


Joined: 12 Mar 2013
Online Status: Offline
Posts: 22
Quote iSing Replybullet Posted: 18 Aug 2013 at 4:42pm

Hi TrevorBradley

This won't fully answer your problem, but it might give you a reasonable starting point.  I haven't used individual formula suppress a whole lot but:
 
The suppress checkbox is independent of the use of a formula for suppressing. 
 
The suppress checkbox, will suppress the field in all instances (eg you need the field on the report, but you don't want it to be visible to end users). 
 
Suppress using a formula gives you further options (eg suppress this field when value is x type of thing). 
 
Suppress when duplicated allows for the situation you're describing.  Crystal is correctly suppressing your duplicated data.
 
 
"If I check the Suppress checkbox, the field is suppressed for BOTH lines."
I'm assuming you have left the formula in & also clicked the checkbox, thus Crystal's behaviour does make sense.  By using the suppress checkbox  you've told Crystal to suppress the field in all instances - this overrides the use of your suppress formula.
I think some of the behaviour you're getting might relate to your grouping. 
 
"If I change the forumla to TRUE, but leave the checkbox unselected, both fields are supressed."
If you are using:
{PODetail.Company} = Previous({PODetail.Company}) then this will result in a true/false, so I can't see how you can "change the formula to TRUE".

I suggest you might want to either re-jig your report so that you don't have duplicate data in the first place OR adjust your grouping etc so that the use of Previous is more effective in the suppress formula. 
 
Suppress via the Section Expert does not appear to be the same as the individual field (as I said, I haven't had a huge amount of use for suppressing indivividual fields)
Suppress checkbox is the same.
Suppress via formula is the same.
Suppress via formula & also the use of checkbox is NOT the same.  I normally use both, as I use the suppress checkbox as a visual reminder that there there is a suppress formula being used in the section expert.
I have recently discovered an instance when this is not helpful (in combination with a parameter for report header & detail suppression), but hey, life wasn't meant to be easy.
 
IP IP Logged
TrevorBradley
Newbie
Newbie


Joined: 16 Aug 2013
Location: Canada
Online Status: Offline
Posts: 4
Quote TrevorBradley Replybullet Posted: 19 Aug 2013 at 7:14am
Awesome, iSing!  That the checkox is independent of the formula (rather than a marker to activate the formula) explains 95% of my problems!  (I think I need to find a resource - book or online - to learn Crystal rather than simply diving in)

I'm still confused by the difference between Supress and Supress when duplicated.  Supress appears to be how I can suppress duplicate rows.  Supress when Duplicated appears to be non functional for two (different) rows with identical fields. 

Is "Suppress If Duplicated" supposed to suppress the field if the entire *row* is duplicated (i.e. "Suppress if Row Duplicated"), rather than a single field (i.e. "Suppress if Field Duplicated")?  That would explain the behaviour I'm seeing. 

The help text for "Suppress If Duplicated" is a bit vague here:  "This option compares record values, not formatted field values."    "Record values" could mean an individual value within a record (unformatted field data) or all the values within a record (complete duplicated rows)
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Aug 2013 at 7:30am
Referring to the format options inside a field:
"suppress" is a straight suppress to always hide the field.
If you use a suppression formula for suppressing then it will suppress the field whenever that formula evaluates to True for that row of data.
I think "Suppress if duplicated" suppresses the field if the previous vaue is the exact same value and it is not the first row on that page and it is not the first record in the group. The exact same value come into play if you are doing a format like on a date time field. YOU might only be showing the date but the field does have time in it and it would only suppress if the prior field had the same date and time if you cannot see the time portion because the way it is displayed.
 
So if you use a formula to suppress as previous(company)=company it would supperss that field when the that condition is met regardelss of any grouping or page changes.
If you use the "Suppress if duplicated" option on the compant field it will only suppress the company field if the previous row is inside the same group, has the same value as the current row and is not the first row on that page.
IP IP Logged
TrevorBradley
Newbie
Newbie


Joined: 16 Aug 2013
Location: Canada
Online Status: Offline
Posts: 4
Quote TrevorBradley Replybullet Posted: 19 Aug 2013 at 8:15am
DBlank, that's not how my "Suppress if Duplicated" is behaving. 

In my test case, I have two rows.  The rows are different, but they happen to share the same field data. The field I'm attempting to suppress has the value "102" in each row - no special formatting and I want to hide the second copy. 

Neither the Supress If Duplicated checkbox nor the forumla have any effect on field suppression.  Checkbox on/off, forumla TRUE or FALSE - there's no suppression.  If I place a formula like previous(company)=company  in the *Suppress* forumla - (not "Suppress If Dupluicated") (without checking the checkbox), it suppresses as expected.

My second row still appears on the first page.  The value is the same irregardless of formatting.  I'm stumped!  I must be missing something simple. (but not so obvious!)

Thanks everyone for your help!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Aug 2013 at 8:29am
so you have no grouping
you have one detail section
you place the company field on the details section
you select "Suppress if duplicated" as true and it does not suppress each subsequent same value from top to bottom?


Edited by DBlank - 19 Aug 2013 at 8:29am
IP IP Logged
TrevorBradley
Newbie
Newbie


Joined: 16 Aug 2013
Location: Canada
Online Status: Offline
Posts: 4
Quote TrevorBradley Replybullet Posted: 19 Aug 2013 at 9:02am
DBlank++.  I have grouping in my report.  Removing grouping makes "Suppress If Duplicated" behave as you've described.

Thanks!
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.032 seconds.