Displaying all Months in Report

webweb Member Posts: 102
Hi;
I have a report that is looking for payments in a table and then display the dates paid for and their amounts.

Now i want to display all the dates queried, wether paid for or not paid for.
The date that are not paid for will have zero amount. Here is the code:
// Initialize variables
FromDate :=010107D;
ToDate :=TODAY;
Amount := 0; TotalAmount := 0; CurrAccTotal := 0;
ContMonth := '';
MonthContAmount := 0;
// Variable initialization ends above.

// Code to Get Previous Contributionsributions
ContributionsOld.SETRANGE("Employee No.",Empid);
ContributionsOld.SETRANGE("From Date",FromDate,ToDate);
ContributionsOld.SETFILTER("From Date",'<%1',FromDate);
ContributionsOld.SETFILTER("To Date",'<%1',ToDate);
// Code Ends Above.

IF ContributionsOld.FIND('-')
THEN BEGIN
OldAmount := ContributionsOld.Quantity;
IF ContributionsOld.NEXT <> 0
THEN REPEAT
OldAmount := OldAmount + ContributionsOld.Quantity;
UNTIL ContributionsOld.NEXT = 0;
END;


Cont.SETRANGE("Employee No.",Empid);
Cont.SETRANGE("From Date",FromDate,ToDate);
Cont.SETFILTER("From Date",'>=%1',FromDate);
Cont.SETFILTER("To Date",'<=%1',ToDate);

IF Cont.FIND('-')
THEN  BEGIN
TotalAmount := Cont.Quantity;
ContMonth := FORMAT(Contributions."To Date",0,'<Month Text>, <Year4>');
Months := Cont.COUNT;
IF Cont.NEXT <> 0
THEN REPEAT
TotalAmount := TotalAmount + Cont.Quantity;
UNTIL Cont.NEXT = 0;
END;

//Formatting Months Below
ContMonth := FORMAT(Contributions."To Date",0,'<Month Text>, <Year4>');
MonthContAmount := Contributions.Quantity;
EndDate := FORMAT(ToDate,0,'<Day> <Month Text>,  <Year4>');
BeginDate := FORMAT(FromDate,0,'<Day> <Month Text>,  <Year4>');
// Formatting Ends above line.


ContMonth display the months.
Any idea please.
Thnaks

Comments

  • matttraxmatttrax Member Posts: 2,309
    I'm guessing you are in a report:

    You could do something with the Date table

    Date data item with filters for your date range
    Values you want to check for that date
  • webweb Member Posts: 102
    an you please suggest a code for me that would work for me. I don't have any idea in using the date dataitem. I am getting the contributions from a table different from the date table. each date should have a corresponding contribution amount
    Any idea?
    Thanks
Sign In or Register to comment.