How to: Create a Company Parameter in a Report [AX 2012]
Updated: November 18, 2011
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
In Visual Studio, open the reporting project.
In Model Editor, expand the node for the report that you want to work with.
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.
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.