How to show a row total amount by group CG Group in Report
I am using Axapta 3.0 with language X++.
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.
Exam: Available report
CG Code Amount Current 1-30days 31-60days 61-180days >180days
1.1 50 10 100 30 10 5
----------
1.1 30 20 60 35 20 20
----------
1.1 20 30 80 7 80 60
----------
1.2 30 50 50 1 100 80
----------
1.2 40 70 90 5 75 15
----------
2.3 100 20 20 150 20 30
----------
3.1 60 10 10 80 10 4
----------
3.1 30 60 5 100 5 60
New report as sample:
CG Code Amount Current 1-30days 31-60days 61-180days >180days
1.1Total 100 60 240 92 110 85
----------
1.2Total 70 120 140 6 175 95
----------
2.3Total 100 20 20 150 0 30
----------
3.1Total 90 70 15 180 15 64
I see the code of available report has SQL sentence as
select AmountMST from CustTransOpen where
custTransOpen.AccountNum == CustTable.AccountNum
&& custTransOpen.TransDate <= balanceAs
&& CustTransOpen.TransDate >= compareDate1
&& CustTransOpen.TransDate <= compareDate2
I have created view to get data from 2table (Custtransopen, Custtable) with name SKV_CustAgỉng3, then I also writ开发者_JAVA技巧e SQL to group CG Group as:
select sum(AmountMST),StatisticsGroup from SKV_CustAging3
group by StatisticsGroup
where SKV_CustAging3.TransDate <= balanceAs
&& SKV_CustAging3.TransDate < compareDate1;
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.
In my opinion, I want to show a row total amount by group CG Group the same example new report above.
Are there any way to show only one record sum total for every CG?
Please help me. I am new officers to make this report, so I don't many experience about Axapta.Thanks.
Try to override send() and fetch() methods of your report. Axapta call fetch() to fetch records which will be printed and Axapta calls send() method for each row, printed in the report. Axapta developers guide contains a detailed information for this methods.
- Override fetch() method and select all necessary data on it
- Use instance of Map class to group the data
- Call send() method to print data.
Find AOT by words "send" and "fetch" to get more examples.
精彩评论