Book Image

Microsoft Dynamics AX 2012 R3 Reporting Cookbook Update

Book Image

Microsoft Dynamics AX 2012 R3 Reporting Cookbook Update

Overview of this book

Table of Contents (17 chapters)
Microsoft Dynamics AX 2012 R3 Reporting Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Adding a parameter for an external datasource query


This recipe will extend the previous recipe to add a parameter that will influence the data retrieved through the SQL query.

Getting Ready

This recipe requires that you have the Adventure Works database installed and you have ready access to the SQL server. This is a continuation of the report developed in the Building a report through an external datasource recipe in this chapter.

How to do it…

  1. Open the project and the report associated with the project.

  2. Select the dataset and open the query editor window to modify the query as shown here:

    SELECT NationalIDNumber, LoginID, JobTitle, BirthDate, MaritalStatus, Gender, HireDate, VacationHours, SickLeaveHours
    FROM HumanResources.Employee
    WHERE (NationalIDNumber LIKE @Id)
    // @ID will be treated as a variable
  3. Click OK to see the parameter reflected in the Parameters node in the dataset and report parameters in the report model. A new popup will show up asking for the parameter; you can key in a valid...