问题
I have a table CustInvoiceJour. I use report to print some info by grouping some fields (Sales Price, SalesUnit in the report Query. Report prints sum(LineDisc), sum(LineAmount) values.
I want to modify report adding one more group by field - but that field is display method. Axapta 3.0 only supports physical fields to group by.
What is the fastest possible way to do that?
回答1:
Sorry, but Axapta 3.0 does not support grouping by a display method and nor do any other version of AX.
AX 2012 support adding a computed field to a view, which would save your day in that version.
In all other version you will have to have a real field, then compute the field on insert or update.
For the CustInvoiceJour
table you only need to change the insert
method, as the table is never updated.
回答2:
Version 1: You can use Map class (Types::Container, Types::Container)to group data manually and MapItertor to send them to report.
Version 2: You can insert your data to temporary table and use 'select ... groupby' from this table to send data to the report.
来源:https://stackoverflow.com/questions/13292409/how-to-group-by-a-table-display-method-in-a-report