Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Highlight records with specific charges + extra Post Reply Post New Topic
<< Prev  Page  of 2
Author Message
lsalih
Groupie
Groupie


Joined: 27 Sep 2007
Location: United States
Online Status: Offline
Posts: 44
Quote lsalih Replybullet Posted: 08 Jul 2011 at 3:49am
I created a new report, followed exactly the steps you listed, and got:
 
1) When I did suppress, the ones who did not match the critiria of
not({CHARGES.CHCODE} in ["chrg123", "chrg345"]) displayed as blank. May be because I did suppress before grouping! Not sure why that happened
 
and
 
2) The flag formula only typed 0, where I know there are records with more than these two charges!
 
Any idea?
IP IP Logged
lsalih
Groupie
Groupie


Joined: 27 Sep 2007
Location: United States
Online Status: Offline
Posts: 44
Quote lsalih Replybullet Posted: 08 Jul 2011 at 4:16am
You know what I did not mention, is the data itself:
 
I wrote below select statement:
 
select  p.PKID, b.lastname, b.firstname, c.chcode from Person P, charges c
where p.PKID= c.PKIDand
p.lastname = 'ABC' and p.firstname = 'XYZ'
 
I got:
 
326 ABC                 XYZ         CHRG07M1
326 ABC                 XYZ         CHRG235
326 ABC                 XYZ         TTSS1111
326 ABC                 XYZ         DDE1111
605 ABC                 XYZ         CHRG123
916 ABC                 XYZ         GRK456
405 ABC                 XYZ         CHRG456
474 ABC                 XYZ         CHRG123
557 ABC                 XYZ         SSS345
943 ABC                 XYZ         MM4567
943 ABC                 XYZ         CHRG123
943 ABC                 XYZ         UTM121
217 ABC                 XYZ         MER345
217 ABC                 XYZ         DES3237M1
 
I assume is the PKID is what is causing the issue because the PKID changes based on number of times entries we entered to the system.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Jul 2011 at 3:19am
so for your sample data you posted, if you add the FLAG formula field as alast fied in the row do you get this?
 
326 ABC                 XYZ         CHRG07M1      1
326 ABC                 XYZ         CHRG235         1
326 ABC                 XYZ         TTSS1111        1
326 ABC                 XYZ         DDE1111         1
605 ABC                 XYZ         CHRG123         0
916 ABC                 XYZ         GRK456           1
405 ABC                 XYZ         CHRG456         1
474 ABC                 XYZ         CHRG123         0
557 ABC                 XYZ         SSS345            1
943 ABC                 XYZ         MM4567           1
943 ABC                 XYZ         CHRG123          0
943 ABC                 XYZ         UTM121            1
217 ABC                 XYZ         MER345            1
217 ABC                 XYZ         DES3237M1      1
IP IP Logged
lsalih
Groupie
Groupie


Joined: 27 Sep 2007
Location: United States
Online Status: Offline
Posts: 44
Quote lsalih Replybullet Posted: 11 Jul 2011 at 3:57am
Yes. Then I can sum that field and flag if sum of that field is greater than 2 and charges are 0 or others.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Jul 2011 at 4:22am
if you group on the first field (326ABC) then you sum the formula on that group footer and you get this:
326 ABC  
326 ABC                 XYZ         CHRG07M1      1
326 ABC                 XYZ         CHRG235         1
326 ABC                 XYZ         TTSS1111        1
326 ABC                 XYZ         DDE1111         1
                                                                    4
605 ABC   
605 ABC                 XYZ         CHRG123         0
                                                                    0
916 ABC 
916 ABC                 XYZ         GRK456           1
                                                                    1
405 ABC
405 ABC                 XYZ         CHRG456         1
                                                                    1
474 ABC 
474 ABC                 XYZ         CHRG123         0
                                                                    0
557 ABC  
557 ABC                 XYZ         SSS345            1
                                                                    1
943 ABC 
943 ABC                 XYZ         MM4567           1
943 ABC                 XYZ         CHRG123          0
943 ABC                 XYZ         UTM121            1
                                                                    2
217 ABC   
217 ABC                 XYZ         MER345            1
217 ABC                 XYZ         DES3237M1      1
                                                                    2
Now anywhere that the SUM <>0 you have a record that is not in your condition
you can use that summarized data to conditionally highlight the group header
IP IP Logged
<< Prev  Page  of 2
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