Walkthrough: Customizing Existing Microsoft Dynamics AX Reports (Visual Studio Reporting Tools for Microsoft Dynamics AX)

Dynamics AX 2009

In this walkthrough, you will customize the Customer Transactions report which is defined in the CustSRS report library that is included with Microsoft Dynamics AX. The Customer Transactions report displays in the Accounts receivable module. Report libraries in Microsoft Dynamics AX adhere to layered development in the MorphX development environment. This allows report libraries to be customized, upgraded, and patched using the built-in layering support. This walkthrough provides an example of how to customize existing reports in Microsoft Visual Studio and import those changes back into Microsoft Dynamics AX.

This walkthrough includes the following tasks:

  • Viewing the report

  • Changing the development layer in Microsoft Dynamics AX

  • Customizing reports in Microsoft Visual Studio

  • Importing customizations into Microsoft Dynamics AX

  • Deploying customized reports to a report server

  • Verifying the results

To complete this walkthrough, you will need:

  • Microsoft Dynamics AX with sample data

  • Microsoft SQL Server 2005

  • Microsoft Visual Studio 2008

  • Microsoft Dynamics AX Reporting Tools for Microsoft Visual Studio

  • Microsoft Dynamics AX Reporting Extensions

You will begin this walkthrough by viewing the report that you will customize in order to familiarize yourself with the report. The following procedure explains how to view the Customer Transactions report within Microsoft Dynamics AX.

To view the existing report in the application

  1. Open Microsoft Dynamics AX.

  2. Open the Navigation Pane if it is not already open. To do this, on the Microsoft Dynamics AX menu, point to View, and then click Navigation Pane.

  3. Select the Accounts receivable module.

  4. In the Navigation Pane, expand the Reports node, expand the Transactions node, expand the Customer node, and then click the Customer Transactions node. The report parameters display.

  5. Specify values for the parameters, and then click View Report.

    In this walkthrough, the changes that you will make to this report include adding a sort order to sort the customer transaction records by transaction date. In addition, you will add a report parameter that will control the display of the transaction text.

Before you customize a report library, be sure that you are working in the correct development layer. There are several layers that are used for making customizations in Microsoft Dynamics AX. For this walkthrough, you will use the bus layer.

To change the development layer

  1. On the Start menu, point to Control Panel, point to Administrative Tools, and then click Microsoft Dynamics AX 2009 Configuration.

  2. On the Developer tab, select bus from the drop-down list in the Application object layer to open field, and then click OK.

    NoteNote

    The configuration utility runs outside Microsoft Dynamics AX. You must stop and restart the client for the changes to take effect.


Next, you will customize the Customer Transactions report which is contained in the CustSRS report library. When you customize an existing report library, a copy of the reporting project for the layer that you are currently working in is created and opened in Microsoft Visual Studio where it can be edited and later imported back into the AOT. In the following procedures, you will add a sort order to sort the customer transaction records by transaction date, and you will add a report parameter that will control the display of the transaction text.

To open the reporting project in Microsoft Visual Studio

  1. Open Microsoft Dynamics AX.

  2. In the AOT, expand the Report Libraries node.

  3. Right-click the CustSRS report library, and then click Edit in Visual Studio.

    The CustSRS reporting project opens in Microsoft Visual Studio. In Solution Explorer, notice that there are two other reporting projects included in the solution. The CustSRS reporting project contains project references to the SharedLibrary and SharedComponentsSRS reporting projects.

  4. In Solution Explorer, expand the node for the CustSRS reporting project, and then double-click CustomerTransactions.moxl to open the report model in Model Editor.

To define a sort order for the transaction date

  1. In Model Editor, expand the CustomerTransaction node if it is not already expanded.

  2. Expand the Designs node, expand the AutoDesign node, and then expand the CustomerTransactionsTable node.

  3. Right-click the Sorting node, and then click Add Sort.

  4. Select the node for the sort order.

  5. In the Properties window, specify the following property values.

    Property

    Description

    Name

    SortTransDate

    Sort By

    =Fields!TransDate.Value

    Sort Order

    Descending

To define a parameter to control the display of transaction text

  1. In Model Editor, right-click the Parameters node for the report, and then click Add Parameter.

  2. Select the node for the parameter.

  3. In the Properties window, specify the following property values.

    Property

    Description

    Data Type

    System.Boolean

    Default Value

    True

    Name

    IncludeTransText

    Prompt String

    Include transaction text

  4. In Model Editor, select the node for the parameter, and then press ALT+UP ARROW to move the parameter up in the parameter list. Continue to do this until the parameter displays below the Includereversed parameter.

  5. Select the Txt field from below the Data node for the report design.

  6. In the Properties window, type =iif(Parameters!IncludeTransText.Value = True, True, False) for the Visible property.

  7. To preview the report, in Model Editor right-click the AutoDesign node, and then click Preview. Specify values for the parameters, and then click the Report tab to view the report. Verify the changes that you made to the report.

  8. Close the Preview window.

Next, you will import the customized reporting project into Microsoft Dynamics AX. During the import process, all required project items are identified. These project items are validated, packaged, and then imported into the AOD. A node for the packaged reporting project displays below the Report Libraries node in the AOT. The customizations made in this walkthrough will be added in the bus development layer.

To import the customized reporting project into Microsoft Dynamics AX

  • In Solution Explorer, right-click the CustSRS reporting project, and then click Save to AOD.

    When you open Microsoft Dynamics AX, you will notice that the CustSRS report library is now updated in the bus layer. If you do not see this, close the Microsoft Dynamics AX client, and then reopen it.

Next, you will deploy the customized CustSRS report library to the report server so that the customizations made to the reports are available to the application.

To deploy the customized report library to the report server

  1. In the AOT, expand the Report Libraries node.

  2. Right-click the CustSRS (bus) node, and then click Deploy. This launches the deployment utility.

  3. Verify the selected report libraries, and then click Next.

  4. Review any messages logged during the deployment process, and then click Finish.

Next, you will verify that the customized report now displays in Microsoft Dynamics AX.

To verify the results

  1. In the Navigation Pane, select the Accounts receivable module.

  2. In the Navigation Pane, expand the Reports node, expand the Transactions node, expand the Customer node, and then click the Customer Transactions node. The report parameters display.

    Notice that the parameter that controls the display of the transaction text now displays along with the other parameters.

  3. Specify values for the parameters, and then click View Report.

    Notice that the transactions are now sorted by transaction date.

Community Additions

ADD
Show: