jehanzebn
Programmer
- May 28, 2001
- 244
Dear all I have created a report with number of set date ranges, daily, last 5 days,last 4 weeks,year to date etc.
The report is pulling everything correctly meaning the total number of jobs, lenses, sub total and grand total are coming correctly. However when I introduced the percentages, they don't come up correctly.
What I am trying to do is to get the report setup with YTD date range and then divided the actual report into Daily, Last 5 days, last 4 weeks and year to date.
So it looks like this
daily records - Last 5 days records - Last 4 weeks records- Year to date records
Then each has subtotals and grand totals.
I want to show each percentage, for example if the last 4 weeks record has 5 then the percentage should be from the grand total of the last 4 weeks jobs.
However that is not the case because I have setup the report records to Yeartodate and when I run the report, though the running totals are fine, the percentage is coming out of the grand total of the year to date.
I am frustrated and sick and tired of trying every thing I could and now I don't know what else to try.
Could someone please help with this.
here is my formula sequence I used for percentage for each one of the date format.
CR Jobs percentage - this is the cr percentage for the daily records
FOC Jobs percentage - This is the FOC percentage for daily records
FOCR Jobs percentage - This is total percentage for daily records
When I set the report record criteria to Currentdate, the percentage comes up correctly for daily date range however then Last 5 days and last 4 weeks shows no data. Year to date shows the same data as current date as it lies on it.
I suspect that I have to setup something on the 1st and 2nd formula before the distinct Count but I don't know what.
I tried like this
CR Jobs percentage edited - used the date range here in this formula but this didn't work either.
Can someone please help me. I am using Crystal Reports 2008 with Informix database via ODBC connection.
Many thanks in advance
Regards
Jehanzeb
Jehanzeb
Crystal Reports 2008
Visual Studio 2008
Informix Database
The report is pulling everything correctly meaning the total number of jobs, lenses, sub total and grand total are coming correctly. However when I introduced the percentages, they don't come up correctly.
What I am trying to do is to get the report setup with YTD date range and then divided the actual report into Daily, Last 5 days, last 4 weeks and year to date.
So it looks like this
daily records - Last 5 days records - Last 4 weeks records- Year to date records
Then each has subtotals and grand totals.
I want to show each percentage, for example if the last 4 weeks record has 5 then the percentage should be from the grand total of the last 4 weeks jobs.
However that is not the case because I have setup the report records to Yeartodate and when I run the report, though the running totals are fine, the percentage is coming out of the grand total of the year to date.
I am frustrated and sick and tired of trying every thing I could and now I don't know what else to try.
Could someone please help with this.
here is my formula sequence I used for percentage for each one of the date format.
CR Jobs percentage - this is the cr percentage for the daily records
Code:
Whileprintingrecords;
Numbervar Jobs:=0;
Jobs:={#TotalCR};
Jobs%DistinctCount({foccredsum.doc_no});
FOC Jobs percentage - This is the FOC percentage for daily records
Code:
Whileprintingrecords;
Numbervar Jobs=0;
Jobs:={#TotalFOC};
Jobs%DistinctCount ({foccredsum.doc_no});
FOCR Jobs percentage - This is total percentage for daily records
Code:
Whileprintingrecords;
numbervar crd:=0;
numbervar focd:=0;
numbervar focrd:=0;
crd:={@JobsPercentageCRDaily};
focd:={@JobsPercentageFOCDaily};
focrd:=crd+focd;
totext(focrd,2)+"%"
When I set the report record criteria to Currentdate, the percentage comes up correctly for daily date range however then Last 5 days and last 4 weeks shows no data. Year to date shows the same data as current date as it lies on it.
I suspect that I have to setup something on the 1st and 2nd formula before the distinct Count but I don't know what.
I tried like this
CR Jobs percentage edited - used the date range here in this formula but this didn't work either.
Code:
Whileprintingrecords;
Numbervar Jobs:=0;
Numbervar jobcounter:= if {foccredsum.line_type}="C" and {foccredsum.date_created} in ((Minimum(last7days))-1) to((Maximum(Last7days))-1) then DistinctCount({foccredsum.doc_no});
Jobs:={#TotalJobsCRL5D};
if jobcounter=0 then 0 else
Jobs%jobcounter;
Can someone please help me. I am using Crystal Reports 2008 with Informix database via ODBC connection.
Many thanks in advance
Regards
Jehanzeb
Jehanzeb
Crystal Reports 2008
Visual Studio 2008
Informix Database