Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Not Exists Equivalent in CR Post Reply Post New Topic
Author Message
ansehnlich
Newbie
Newbie


Joined: 27 May 2010
Location: United States
Online Status: Offline
Posts: 1
Quote ansehnlich Replybullet Topic: Not Exists Equivalent in CR
     Posted: 27 May 2010 at 1:47pm
I have this situation. Will try to simply explain it
Tables - A B C (Database expert used - joined by a matching key, with A driving table)

B and C has multiple records for matching key ( B has 2 records for each record in A and C has more than 2 records for each record in A)



My question is how to

1. Write formula in selection criteria to exclude records from getting selected (using selection criteria formula) if value of a field in table C has a particular value (i want entire recordset NOT selected not just the records with this value).

2. Suppress duplicate display for records.



Data selected for A.id = 1 will look like this



A.id    b.b_id     c.c_name
1       2              ABC
1       2              XYZ
1       2              PQR
1       3              abc
1       3              xyz
1       3              pqr

what I want to do is, exclude this records from getting selected if C.c_name = PQR, also for other records I want to suppress duplicate display of records i.e display one record for b.b_id = 2 and b.b_id = 3 (no need to display any field from table C)



Thanks in advance.

Edited by ansehnlich - 27 May 2010 at 7:04pm
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 28 May 2010 at 3:11am
you can't...CR isn't that versatile.  The simplest solution to accomplish this is to write a stored procedure, there you can delete a whole group or really do anything that you want.
 
CR can only read 1 record ahead and 1 record behind, but it can't affect those records.
 
Another way to accomplish this would be to have a subreport run for each group and do some conditional suppression there as well as having either running totals or formulas that act as running totals / flag so that the totals displayed match the values displayed (obviously, the first solution--stored proc is simpler in the long run)
 
HTH
IP IP Logged
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