Search code examples
crystal-reportscrystal-reports-2008crystal-reports-2010

How to Count Duplicate Values in Crystal Reports?


I made a report in Crystal Reports using Visual Studio 2010, what i want to achieve showed In this Screen Shot. Screen Shot!

In the report i want to count Free Patients, Please Help me i am new in the programming any help would be greatly appreciated


Solution

  • Create a variable, like :

    numbervar cnt := 0;
    if({FeeStatus} = "Free") then cnt  := 1 else cnt := 0;
    

    Now place this variable in the detail section and suppress it, as there is no need to show on the report.

    Now, it depends whether you want to show the Sum in the Report footer, or you have a group footer.

    Add Summary > and choose the varibale created and suppressed earlier (cnt)
    

    Now, place this Summary as per your need.

    Note : The more you will play with Crystal, better you will understand it's flow.