使用Axapta报告工具从同一行的不同表打印列的最佳方法是什么?

时间:2023-01-11 13:17:13

It seems like each body section in an axapta report can only print columns from a single table(consistantly). For instance: I have a report that has the following tables: SalesLine, InventTable and CustTable. Then I would like to print columns from each of this tables on the same row. It seems like I can do this when placing the fields in programmable sections but not when I place them in body sections.

似乎axapta报告中的每个主体部分只能打印单个表中的列(相继)。例如:我有一个包含以下表格的报表:SalesLine,InventTable和CustTable。然后我想在同一行上打印每个表中的列。看起来我可以在将字段放在可编程部分时执行此操作,但是当我将它们放在正文部分时则不行。

I have found a few workaround that are either ugly or non-performant. There has to be a nice clean way to do this?

我发现了一些难以理解或不具备性能的解决方法。必须有一个很好的干净方法来做到这一点?

4 个解决方案

#1


4  

It should be possible to do this, there are several reports in the base system that work this way. Look at the SalesContractShipment report in 4.0 as an example.

应该可以这样做,基本系统中有几个报告以这种方式工作。以4.0中的SalesContractShipment报告为例。

On your report, create a datasource for SalesLine, and under that create datasource each for InventTable and CustTable. On InventTable and CustTable, make sure the FetchMode is set to 1:1. If you create a custom fetch method, make sure you call send() in the correct order. You should send CustTable first, then InventTable, then SalesLine last. On the report design, create a single body for SalesLine. You should then be able to use fields from any of the three tables in that body.

在您的报表上,为SalesLine创建数据源,并在其下为InventTable和CustTable创建数据源。在InventTable和CustTable上,确保将FetchMode设置为1:1。如果您创建自定义提取方法,请确保以正确的顺序调用send()。您应首先发送CustTable,然后发送InventTable,然后发送SalesLine。在报表设计中,为SalesLine创建单个正文。然后,您应该能够使用该主体中三个表中任何一个的字段。

If you are still having trouble, I can think of two work arounds. One is to create a view based on those three tables, and create a report based on that view. The other is to create the report based on SalesLine and use displayMethods to lookup any fields you need from InventTable or CustTable.

如果你仍然遇到麻烦,我可以想到两个工作。一种是基于这三个表创建视图,并基于该视图创建报告。另一种是基于SalesLine创建报告,并使用displayMethods从InventTable或CustTable中查找所需的任何字段。

#2


1  

You should be able to add multiple data sources to a report then create one body for the first data source that you added. Right-click the body and select New Control -> Field From AnyTableThatIsADataSource. You can then add any field that you want and it will print columns for all of those fields.

您应该能够向报表添加多个数据源,然后为您添加的第一个数据源创建一个正文。右键单击正文并从AnyTableThatIsADataSource中选择New Control - > Field。然后,您可以添加所需的任何字段,它将打印所有这些字段的列。

#3


1  

Put all the fields in the last SourceTable_Body and it'll show all the fields, because the QueryRun table by table and fill the body with each corresponding Body, so the last body will have all fields' data.

将所有字段放在最后一个SourceTable_Body中,它将显示所有字段,因为QueryRun表按表填充并且每个对应的Body填充正文,因此最后一个正文将包含所有字段的数据。

#4


0  

Consider using temporary tables. Fill it with your data first, than use in the report.

考虑使用临时表。首先填写您的数据,而不是在报告中使用。

#1


4  

It should be possible to do this, there are several reports in the base system that work this way. Look at the SalesContractShipment report in 4.0 as an example.

应该可以这样做,基本系统中有几个报告以这种方式工作。以4.0中的SalesContractShipment报告为例。

On your report, create a datasource for SalesLine, and under that create datasource each for InventTable and CustTable. On InventTable and CustTable, make sure the FetchMode is set to 1:1. If you create a custom fetch method, make sure you call send() in the correct order. You should send CustTable first, then InventTable, then SalesLine last. On the report design, create a single body for SalesLine. You should then be able to use fields from any of the three tables in that body.

在您的报表上,为SalesLine创建数据源,并在其下为InventTable和CustTable创建数据源。在InventTable和CustTable上,确保将FetchMode设置为1:1。如果您创建自定义提取方法,请确保以正确的顺序调用send()。您应首先发送CustTable,然后发送InventTable,然后发送SalesLine。在报表设计中,为SalesLine创建单个正文。然后,您应该能够使用该主体中三个表中任何一个的字段。

If you are still having trouble, I can think of two work arounds. One is to create a view based on those three tables, and create a report based on that view. The other is to create the report based on SalesLine and use displayMethods to lookup any fields you need from InventTable or CustTable.

如果你仍然遇到麻烦,我可以想到两个工作。一种是基于这三个表创建视图,并基于该视图创建报告。另一种是基于SalesLine创建报告,并使用displayMethods从InventTable或CustTable中查找所需的任何字段。

#2


1  

You should be able to add multiple data sources to a report then create one body for the first data source that you added. Right-click the body and select New Control -> Field From AnyTableThatIsADataSource. You can then add any field that you want and it will print columns for all of those fields.

您应该能够向报表添加多个数据源,然后为您添加的第一个数据源创建一个正文。右键单击正文并从AnyTableThatIsADataSource中选择New Control - > Field。然后,您可以添加所需的任何字段,它将打印所有这些字段的列。

#3


1  

Put all the fields in the last SourceTable_Body and it'll show all the fields, because the QueryRun table by table and fill the body with each corresponding Body, so the last body will have all fields' data.

将所有字段放在最后一个SourceTable_Body中,它将显示所有字段,因为QueryRun表按表填充并且每个对应的Body填充正文,因此最后一个正文将包含所有字段的数据。

#4


0  

Consider using temporary tables. Fill it with your data first, than use in the report.

考虑使用临时表。首先填写您的数据,而不是在报告中使用。