Reports in Dynamics 365FO

Creating our own report remains the same as it was in the 2012 version.
However, modifying existing reports changed quite a bit. You can’t actually create an extension of a report, but you can duplicate and then modify it.

Extending a report

If the report’s output menu item is linked to a controller class

If the controller class returns a controller object

You have to create a post event handler for this construct() method, and modify the parmReportName in order to get the desired report design.

If the controller class doesn’t return a controller object

Duplicate the class and change the name of the design to the one you want to display.
Extend the output menu item of the report, and enter the name of the controller’s class to the ‘Object’ property.

Print Management

If the report is based on Print Management (e.g. SalesConfirm)

The report’s controller class contains PrintMgmt methods.

https://blogs.msdn.microsoft.com/dynamicsaxbi/2017/01/01/how-to-custom-designs-for-business-docs//

If the report is not based on Print Management

https://blogs.msdn.microsoft.com/dynamicsaxbi/2016/12/27/how-to-expanding-app-suite-report-data-sets/

If the report’s output menu item is not linked to a controller class, and the report gets called directly by the menu item (e.g. smmActivityAnalyses)

Extend the output menu item.
Change the “Report Design” property to your report design’s name.

Report design

Designing reports remained exactly the same as it was in the previous version.

Example

Extending the CustInvoiceJour report with an additional field.

Create a new project in a model, that references the Application Suite, because that’s what the CustInvoiceJour’s base model is.

Extend the CustInvoiceJourTmp table and add the field to the Fields folder.

Duplicate the CustInvoiceJour report. You can rename it by right click and ‘Rename’.

You can either modify the default report design, or you can duplicate it and then modify that one.

Duplicate the CustInvoiceJourController class, rename it to something like CustInvoiceJourControllerExt and insert your design’s name.

Duplicate the CustInvoiceJourDP class and add value to your new field.

Change the report dataset’s query to the new DP class.

Extend the CustInvoiceJourReport output menu item and add the name of your controller class to the ‘Object’ property.

You can also set this menu item as Startup Object, so that when you run the project, this will be opened automatically.

Source

Most of the information came from Sohaib Cheema’s topic about reports.

https://community.dynamics.com/365/financeandoperations/b/microsoftdynamicsaxextensions/archive/2018/05/18/msdyn365fo-ssrs-extensions-part-1



Leave a Reply

Your email address will not be published. Required fields are marked *