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

Expression in reports


Expression is a very interesting property in SSRS reports. It is mostly used to do customizations at runtime. Expressions are basically used to change report appearances and report content at runtime. Microsoft Visual Studio has some built-in functions that can be used in expressions. In this recipe, we will implement the most important feature of printing the alternate line in different colors.

How to do it…

  1. In the template, select the DetailRowStyle | FieldValueStyle node.

  2. For the Background Color property, choose the <Expression...> list:

  3. The Edit Expression window will pop up.

  4. Type the following expression in the Edit Expression window, as shown in the screenshot:

    =iif(RowNumber(Nothing)mod 3, "#e0e0e0", "#ffe0c0")
  5. Save the template and go back to the PktCustTransList report for a preview.

  6. The report should now appear with a different color on every third line when previewed, as seen in the following screenshot:

How it works…

Expressions are a powerful means through...