In the last blog, I told you how to create Dynamic Fetch Report using Parameters.
Now In this blog, we will tell you How to Implement Expressions in Dynamics 365 SSRS Reports using in-build Functions.
Microsoft Dynamics Reporting Service is a tool used to create customized SSRS reports for your CRM Records. You can implement custom styling, functions and expressions using the fetch queries and provided in-build functionalities.
Expressions can be added in any textbox, tables, custom values or any other area where you need to give some input. In our example, we are using a sample text box to enter some calculation expressions.
First of all make sure you created a Dataset and fetched all of your required fields:
Step 1. Dynamic Field Values from Datasets
To enter simply the value of a particular field which you fetched, you can just select the appropriate field from Fields or Datasets.
Step 2. Checking Null Values in Fields
Reporting Service tool provides you the function to check if nothing exists in the field as a value.
Select IsNothing() function then select the field for which you want to perform the check. The function will return True if the value is Null otherwise it will be False.
Tip: If you are having a confusion in the above function, you can also try adding Not with IsNothing() to reverse the return values.
ForExample: Not IsNothing(<Field-Name>)
Step 3. Using If/Else Condition
You can also use If and Else in your report, here it is denoted as:
IIF(<expression>, <True condition>, <False condition>)
The If condition will execute the expression in the middle if the condition is true otherwise, the expression in the last will be executed.
You can also use nested If conditions if you put another If condition in the Else condition.
Step 4. Using AND, OR, NOT…
The Reporting Service tool also provides you the flexibility of using Bitwise Logical Operators such as AND, OR, etc.
These logical operators work the same as you use in any of the programming languages.
Step 5. Using Date Functions
You can also use some of the in-build date functions. Some of them are
Now(): This function returns the current date and time as per the system.
Today(): The function returns the today’s date along with timestamp.
There are many other functions which you can use to get your desired values and expressions. There are some other commonly used functions as well such as Avg(), Int(), DateAdd(), LookupSet(), Sum(), etc.