Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I hide a total on a group in Reporting Services

Posted on 2008-06-24
7
Medium Priority
?
1,955 Views
Last Modified: 2011-10-19
I would like to hide a total line on a group if the result is only one row.  
So for instance, I have:
Group 1                            
Item 1 $40
Item 2 $30
Item 3 $30
Total $100
Item 4 $20
Total $20
Group Total $120

I would like to eliminate that total if there is only one item so it would look like:
Group 1                            
Item 1 $40
Item 2 $30
Item 3 $30
Total $100
Item 4 $20
Group Total $120

So, can it be done and if so how?  I have this expression in the visibility hidden property but it doesn't quite work:  =Iif(CountRows("table2_part1") <> 1, False, True)
0
Comment
Question by:DawnAR
  • 4
  • 3
7 Comments
 
LVL 12

Expert Comment

by:jgv
ID: 21856732
Your expression should be working but you don't need an IIF statement in the expression for the Hidden property.
=CountRows("table2_part1") <= 1

Make sure that you are referencing the proper group as the scope in the CountRows() function. From your example, it looks like you may have 2 groups. The CountRows should have the inner group (the group where the footer should be suppressed if only 1 row) as the scope.
0
 

Author Comment

by:DawnAR
ID: 21857094
That didn't work.  I attached my results (using example names).
I have 3 groupings in Table2.  Part2 is my overall group, then Part1, then Expense.  So in my example, Engines and Glass belong to Part2 (1st group); Gas Tank, Air Filter, type of windshield belong to Part1 (2nd group - this is the total line I want elimated); and then last my 3rd group, Expense, which are fuel pump, filter, gas, air filter, etc.

example.xls
0
 
LVL 12

Expert Comment

by:jgv
ID: 21857488
Are you getting an error with the CountRows or it does not have any effect? Also, why are you using a group (instead of the details section) for the 3'rd group, expense? From the sample data the expense items appear to be the details of the report.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:DawnAR
ID: 21858013
No error, it just doesn't seem to have any effect.  The 3rd group has to be a group as well; and that's showing in the group footer.  There would be way too many rows of detail if I didn't make it a group.  I simplified the numbers in my attached example, but technically the "expense" amount is more like in the thousands as there are many fuel pumps, filters, etc. listed in the detail section.
0
 

Author Comment

by:DawnAR
ID: 21858070
Also, attached is a screenshot of my .rdl so you can see my groups, and maybe that will help too.
rdlexample.bmp
0
 
LVL 12

Accepted Solution

by:
jgv earned 1000 total points
ID: 21858363
CountRows counts all of the rows (details that make up the group total) not just the number of group rows. You may only have 1 total row in the group (ie: Air Filter in your sample) but that is probably made up of numerous detail records which means that the CountRows is likely always greater than 1.

Try this instead. The first parameter should be a field that uniquely identifies the type of detail row (Fuel Pump, Fuel Filter, etc).
=CountDistinct(Fields!AUniqueField.Value, "table2_part1") <= 1
0
 

Author Closing Comment

by:DawnAR
ID: 31470179
Thank you! ! That worked!  I appreciate the help and the clarity of why my example wasn't working.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question