How to Display Blanks as Zeros in a SSRS Report
How to Display Blanks as Zeros in a SSRS Report
Some of the cells in this SSRS matrix report are blank:
To display zeros instead, we will use two functions:
1.
1 | IsNothing(<Val2Check>) returns a True of Val2Check is Null; otherwise, it returns False |
2.
1 | IIF(<Test>, <IfTrue>, <IfFalse>) return <IfTrue> if <Test> is True; otherwise, it returns <IfFalse> |
In the design of the matrix, right-click on the textbox containing the values in question, then select Expression… to edit the expression underlying the textbox.
Type the following expression in the Expression dialog:
The expression says that if SUM(Fields!SubTotal.Value) is Null (the IsNothing() function that it is in returns a True if it is Null and a Fales if it isn’t), then a zero is returned by the expression; otherwise the SUM(Fields!SubTotal.Value) is used.
Click OK and preview the report again. Notice that zeros are now present in what used to be the blank cells.
Enjoy!
Peter Avila
SQL Server Instructor – Interface Technical Training
Phoenix, AZ
You May Also Like
A Simple Introduction to Cisco CML2
0 3850 0Mark Jacob, Cisco Instructor, presents an introduction to Cisco Modeling Labs 2.0 or CML2.0, an upgrade to Cisco’s VIRL Personal Edition. Mark demonstrates Terminal Emulator access to console, as well as console access from within the CML2.0 product. Hello, I’m Mark Jacob, a Cisco Instructor and Network Instructor at Interface Technical Training. I’ve been using … Continue reading A Simple Introduction to Cisco CML2
Difference Between $_ and $PSItem in Windows PowerShell
2 1905 4In this video, I’m going to answer a very common question that I get when I’m teaching Windows PowerShell, and that’s, “What’s the difference between what’s called $_ and $PSItem?” Let me explain to you a little bit about what these two variables do. When we’re working with the PowerShell pipeline, and we want to … Continue reading Difference Between $_ and $PSItem in Windows PowerShell
How to Build in a PSMethod to your PowerShell Code
0 72 0In this video, PowerShell instructor Jason Yoder shows how to add Methods (PSMethod) to your code using free software that’s added into the PSObject. For instructor-led PowerShell courses, see our course schedule. Microsoft Windows PowerShell Training Download the Building Methods PowerShell script</a> used in this video. <# ╔══════════════════════════════════════════════════════════════════════════════╗ ║ ║ ║ Building Methods ║ ╟──────────────────────────────────────────────────────────────────────────────╢ … Continue reading How to Build in a PSMethod to your PowerShell Code
See what people are saying...