How to: Create a Company Parameter in a Report

Important

This content is archived and is not being updated. For the latest documentation, see Microsoft Dynamics 365 product documentation. For the latest release plans, see Dynamics 365 and Microsoft Power Platform release plans.

Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

This topic describes how to create a parameter to control the data for a report based on a company. On a report, parameters are used to filter data, control appearance, and connect to related reports. When you create a company report parameter for a report, and then run that report, you enable the user to choose the company on which the report data will be based.You will use the AX_CompanyName parameter that is added to a report model by the reporting framework when you add a dataset bound to a data source. The AX_CompanyName parameter is a mandatory framework parameter. The parameter cannot be null, cannot be blank, and has the following default value =Microsoft.Dynamics.Framework.Reports.BuiltInMethods.GetUserCompany(Parameters!AX_UserContext.Value). The following steps describe how to use the AX_CompanyName parameter to filter data based on company.

To create a company parameter in a report

  1. In Visual Studio, open the reporting project.

  2. In Model Editor, expand the node for the report that you want to work with.

  3. Expand the Parameters node for the report, and then select the AX_CompanyName parameter. The AX_CompanyName parameter is added by the reporting framework after you bind the dataset to a data source.

  4. In the Properties window, set the Visibility property to Visible.

Next, you can create a design in your report model and then deploy the report to see the company parameter. For more information, see How to: Create an Auto Design for a Report.

See also

Working with Parameters