Referencing image, if A=0 how may row 2 (details) be suppressed?
(I added row visibility expression =IIF(Sum(Fields!Amount.Value)=0, True, False) to all three rows, the group rows suppress not the details)
Thank you.
When using an aggegate function like Sum
without specifying a scope, then the scope will be the "current" scope. In the group header or footer, this will be the group, and the sum will evaluate to what you want. Instead in a details row, the scope will be the details row only, so the value of the sum will be the same as the Amount value in the details row (I don't believe that Crystal would calculate differently). Therefore, if you want to use the Row Visibility, you will have to make sure that the formula takes the same value for all 3 rows. For example, you could name the TextBox holding the sum something like VendorTotal
, and for the Row Visibility of all 3 rows specify an expression of
=(ReportItems!VendorTotal.Value=0)
But why hide the individual rows when you can hide the group as a whole?
The Group Properties also contain a visibility setting, and you can even specify the condition as an expression using the Sum
function directly (without referencing a TextBox):
=(Sum(Fields!Amount.Value)=0)