Crystal report + record count base on condition

Posted on 2007-08-07
Last Modified: 2013-11-15
I have a problem in Crystal Report. I want to count the field in the report as describe below
I have a datatable with this schema
         filed:   name,  address,  gender,  group
 with data:   abc       pp           male          001
                   asd       pp           male          001
                   xml        kd           female       001
                   def        kd           female       002
                   ghi         kd           female       002
                   klm         sv           male         002
I have generate a report in two pages by grouping on [group] field.

So my first page should be :
                  head1  head2     head3
                   abc       pp           male        
                   asd       pp           male        
                   xml        kd           female      

and the second one is
                  head1  head2     head3
                   def        kd           female      
                   ghi         kd           female      
                   klm         sv           male        

I want to have summary in the footer in each page by
page one : Number of male 2
                  Number of female 1

page two : Number of male 1
                  Number of female 2

but I dont know how to do? I have try to do a count on the field [gender] but it count for all not for a specific gender as I wish to do.

Could you please guide me how to solve this problem? I am very new to Crystal Report.

Best regards,

Question by:veasnamuch
    LVL 53

    Expert Comment

    Are you sure you added the count on the right group footer ?
    LVL 1

    Author Comment

    LVL 53

    Expert Comment

    Perhaps you can create an extra grouping (based on gender). In the details of the group you won't fill in anything and use that footer to fill in the count
    LVL 1

    Author Comment

    Finally I found the solution... the cause is that I try to comapre a unicode string with the text fields that is why the fomula that I do some count does not work. As right now, I change the data to an ASCII character so that the compare string is success.

    Thanks for your valuable time,

    Veasna Much

    LVL 53

    Expert Comment

    Good to see that your problem is solved
    LVL 1

    Accepted Solution

    PAQed with points refunded (50)

    EE Admin

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
    Hi, In my previous Article  ( discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now