How to display only total amount row by group CG code?

Hello all Experts!

I am using Axapta 3.0 with language X++ and I am making a report based on available report. The new report only shows a total row by group CG Group instead of showing all detail row as old report.

Here’s the context all field in old report: (available report)

CG Code Amount Current 1-30days 31-60days 61-180days

1.1 5 10 15 20 22

1.1 6 2 2 5 5

1.2 6 5 1 6 6

2.3 1 2 3 5 5

2.3 5 20 30 50 10

I want to make the report as sample below by sum total above report by group CG Code:

CG Code Amount Current 1-30days 31-60days 61-180days

1.1 11 12 17 25 27

1.2 6 5 1 6 6

2.3 6 22 33 55 15

According to available report, I see the datasource is get from table “CustTable”

-Column “CG Code” in report gets from CustTable.StatisticGroup.

-Column (Amount, Current, 1-30days,31-60days,61-180days) is got from method as:

Method is written as:

display Amount getCalTotalAmountMST()


CustInvoiceJour custInvoiceJour;

CustTransOpen custTransOpen;

TransDate compareDate;

TransDate balanceAsSika;


compareDate = startDate - CustTable.SKV_PaymtDay();

totalAmountMST = 0;

select AmountMST from CustTransOpen

where CustTransOpen.TransDate <= balanceAs

&& CustTransOpen.AccountNum == CustTable.AccountNum;

totalAmountMST += custTransOpen.AmountMST;

return totalAmountMST;


-Similar with column “Current”, “1-30days”, “31-60days”…also is written method for every column.

and method Send() also is written to show all record the same with the data available above.

But I aslo try to use “Section Group” to total amount every CG Group but the report still shows detail record and The end of section group shows total amount. It doesn’t disable detail record.Are there any way to show only one record sum total for every CG?

(The expert said that I try to write fetch() method but I don’t know how to write it.Please help me.Thank you for your answer.