How to Display Blanks as Zeros in a SSRS Report

Home > Blogs > SQL Server > How to Display Blanks as Zeros in a SSRS Report

How to Display Blanks as Zeros in a SSRS Report

Like This Blog 1Peter Avila
Added by November 12, 2014

Some of the cells in this SSRS matrix report are blank:

001-How-to-Display-Blanks-as-Zeros-in-a-SSRS-Report

To display zeros instead, we will use two functions:

1.

2.

 

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.

002-How-to-Display-Blanks-as-Zeros-in-a-SSRS-Report

Type the following expression in the Expression dialog:

003-How-to-Display-Blanks-as-Zeros-in-a-SSRS-Report

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.

You may also like:  Microsoft White Paper - SQL Server 2016 and Windows Server 2016 Better Together

Click OK and preview the report again. Notice that zeros are now present in what used to be the blank cells.

004-How-to-Display-Blanks-as-Zeros-in-a-SSRS-Report

Enjoy!

Peter Avila
SQL Server Instructor – Interface Technical Training
Phoenix, AZ

Videos You May Like

JavaScript for C# Developers – September 24, 2014

0 117 1

In this video Dan Wahlin demonstrate the similarities and differences between C# and JavaScript and the future of JavaScript (ES6).

Subnetting a TCP/IP Network using the Magic Box Method

0 225 0

In this session, we are going to look at how to subnet a Class B address into multiple network segments using what's called The Magic Box. Let's run through this real quick.

Detailed Forensic Investigation of Malware Infections – April 21, 2015

2 122 1

In this IT Security training video, Security expert Mike Danseglio (CISSP / CEH) will perform several malware investigations including rootkits, botnets, viruses, and browser toolbars.

Write a Comment

See what people are saying...

  1. sivakumar

    i used above code its working …
    But its displaying only one zero ,i need 0.00 like this

Share your thoughts...

Please fill out the comment form below to post a reply.