Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2008

    Question Unanswered: Printing summarized numbers in Reporting Services

    I am new at Reporting Services. I've always used Crystal Reports. I have a textbox in a matrix containing the following expression: =IIF(Sum(Fields!Expr1.Value) > 0, Fields!Expr1.Value,0) where Expr1 is the result of the count(*) funtion in the dataset sql statement. This will print a 0 on the report if there is no value for that particular item. It looks nice, but this makes the subtotals not add up correctly. The subtotal appears to be just the first value > 0 that is found, instead of adding up all the values. If I change the expression to =Sum(Fields!Expr1.Value) the subtotals work, but the report doesn't look as nice. Anyone know what my roadblock might be?

  2. #2
    Join Date
    Nov 2004
    Provided Answers: 4
    =IIF(Sum(Fields!Expr1.Value) > 0, Fields!Expr1.Value,0)
    I don't know if this will work, but you need something in the line of:
    =Sum(IIF(Sum(Fields!Expr1.Value) > 0, Fields!Expr1.Value,0)
    With kind regards . . . . . SQL Server 2000/2005/2012

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts