简体   繁体   English

如何在报表中按表格显示方式分组?

[英]How to group by a table display method in a report?

I have a table CustInvoiceJour. 我有一个表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. 我使用报表通过将某些字段(报表查询中的销售价格,SalesUnit)分组来打印一些信息。报表打印sum(LineDisc),sum(LineAmount)值。

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. Axapta 3.0仅支持分组的物理字段。

What is the fastest possible way to do that? 最快的方法是什么?

Version 1 : You can use Map class (Types::Container, Types::Container)to group data manually and MapItertor to send them to report. 版本1 :您可以使用Map类(Types :: Container,Types :: Container)手动对数据进行分组,并使用MapItertor将其发送给报表。

Version 2 : You can insert your data to temporary table and use 'select ... groupby' from this table to send data to the report. 版本2 :您可以将数据插入临时表,并使用此表中的“ select ... groupby”将数据发送到报表。

Sorry, but Axapta 3.0 does not support grouping by a display method and nor do any other version of AX. 抱歉,但是Axapta 3.0不支持通过显示方法进行分组,也不支持任何其他版本的AX。

AX 2012 support adding a computed field to a view , which would save your day in that version. AX 2012支持在视图中添加一个计算字段 ,这可以节省您在该版本中的工作。

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. 对于CustInvoiceJour表,您只需要更改insert方法,因为该表永远不会更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM