Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to print columns from different tables on the same row using the Axapta reporting tool?

Tags:

axapta

x++

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.

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

like image 258
James Moore Avatar asked Oct 24 '08 23:10

James Moore


2 Answers

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.

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.

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.

like image 148
Jay Hofacker Avatar answered Oct 19 '22 20:10

Jay Hofacker


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.

like image 1
Michael Brown Avatar answered Oct 19 '22 18:10

Michael Brown