I am trying to create a report from sales header to display the total amount month wise
I have taken sales header table and i have to show currency wise amount
and tried to group on currency code in layout but not getting how to group monthwise.
the report is being printed for the starting month and all amount are printed in the Report.
0
Comments
i got the report
this is the code for the same.
I have defined start date end date as filter in report page
OnPreReport()
IF((sdate = 0D) AND (edate = 0D)) THEN
ERROR(Text000);
OnPostReport()
Sales Header - OnPreDataItem()
SETFILTER("Document Date",'%1..%2',sdate,edate);
CurrReport.CREATETOTALS("Amount to Customer");
SrNo :=0;
Start:= DATE2DMY(sdate,2);
Sales Header - OnAfterGetRecord()
USDTotal:=0;
EuroTotal:=0;
Month:=0;
Year:=0;
Month:= DATE2DMY("Document Date",2);
MonthName :=FORMAT("Document Date",0,'<Month Text>');
Year:= DATE2DMY("Document Date",3);
IF Month <> AfterMonth THEN
SrNo := SrNo+1;
IF "Currency Code" <> '' THEN BEGIN
IF "Currency Code" = 'USD' THEN BEGIN
CALCFIELDS("Amount to Customer");
USDTotal := "Amount to Customer";
END;
IF "Currency Code" ='EURO'THEN BEGIN
CALCFIELDS("Amount to Customer");
EuroTotal := "Amount to Customer";
END;
END;
AfterMonth:= DATE2DMY("Document Date",2);
did grouping on month in report of rtc
and will get the result