I am using Crystal 10. I have created a report to count the volume of a certain procedure by month, displayed in a row:
2010 Jan Feb March .....Dec
10 15 12 20
My report is grouped by Month (which is taken from the "case_date")
In my detail section, I have created a counter for each month to count "case numbers" ( there can be duplicate rows and I only want them counted once):
*********
whileprintingrecords;
numberVar JanCounter;
JanCounter:=
if {@Month}=1
and (onfirstrecord
or ({case_number}<>previous({case_number})))
then JanCounter:=JanCounter+1
else JanCounter:=JanCounter
*********
I initialize JanCounter in the Month group header.
This gives me:
Case number JanCounter
10045 1
10045 1
10322 2
10523 3
I then have another variable JanuarySubtotal
which I place in the Group footer.
*******************
whileprintingrecords;
numbervar JanSubtotal;
JanSubtotal:={@JanCounter}
********************
This works fine except for the last month in the report. It is adding one more to the last month's total. So if I run the report through June 30, the June total is 1 more than it should be. If I run it through Dec 15, Dec is 1 more than it should be.
Can somebody help me please?????
2010 Jan Feb March .....Dec
10 15 12 20
My report is grouped by Month (which is taken from the "case_date")
In my detail section, I have created a counter for each month to count "case numbers" ( there can be duplicate rows and I only want them counted once):
*********
whileprintingrecords;
numberVar JanCounter;
JanCounter:=
if {@Month}=1
and (onfirstrecord
or ({case_number}<>previous({case_number})))
then JanCounter:=JanCounter+1
else JanCounter:=JanCounter
*********
I initialize JanCounter in the Month group header.
This gives me:
Case number JanCounter
10045 1
10045 1
10322 2
10523 3
I then have another variable JanuarySubtotal
which I place in the Group footer.
*******************
whileprintingrecords;
numbervar JanSubtotal;
JanSubtotal:={@JanCounter}
********************
This works fine except for the last month in the report. It is adding one more to the last month's total. So if I run the report through June 30, the June total is 1 more than it should be. If I run it through Dec 15, Dec is 1 more than it should be.
Can somebody help me please?????