Excellent. It works. Much appreciated for all the replies.
I need to keep the details as the requirements might be changed to display certain detail rows for specific items even when show detail parameter is set to No.
Thanks a lot. This is what I was looking for.
Original Message:
Sent: Tue August 01, 2023 01:05 PM
From: Marc Reed
Subject: Hide a row based on a condition
I should have also added... that when you want to hide the details, you probably would want the summary rows to no longer look like summary rows. For example this list now looks pretty poor:

You can use a conditional style to format these summary rows differently. This single list now needs to:
- have a calculation to remove the month from the query for efficiency
- hide the detail rows
- hide the detail columns
- reformat the summary rows so they look like detail rows when the details arent needed.
But, whilst this is all very clever, to make one list do everything, an alternative is to simply just have two distinct lists. One for the detail view, the second for the view without details. This means you have two simple lists, rather than one complicated list and complicated query. You then show the appropriate list using a render variable.
For me, in the above case of a list with Year, Month and Quantity I would go the two list approach. There is a time for the single list approach, and for me that is when the user wants to hide numerous detail columns, and they can control which individual detail columns to switch on/off.
------------------------------
Marc Reed
Original Message:
Sent: Tue August 01, 2023 02:59 AM
From: Marc Reed
Subject: Hide a row based on a condition
Firstly I would say Investigate the use of the new(ish) Data Table object. This is an object that allows the user to expand/collapse detail rows without a report author doing anything clever. You can start this in a collapsed state too. It allows user filters and all kinds of fancy stuff.


If a data table isn't suitable then you are down to using a parameter and conditional styles.
On the list select the 'List Columns Body Style Object:

And apply a conditional style, something like :

Where the Style has Box Type set to None. This will hide the detail rows:

The above is what most beginner report authors would do. But it isn't the best answer.
In the above example my detail rows are Month. If the user doesn't want the detail rows then we return 12 months of detail and then just hide them. Whilst in my example this is a trivial amount or rows, imagine if my detail rows were order number. We could return millions of rows of detail to just hide them, a very poor report.
To make the report better I would change the Month date item to be something like:
case when ?pHideDetail? <> 'Hide Detail' then [Month] end
I would then change the conditional style we had above to
[Month] is null
That way I am only using the param logic once in the query. If we change the parameter, or the parameter answers, I only have one object to edit.
Lastly I would create a variable to Hide the month column in the no detail mode.
Create a boolean variable based on the parameter. And use this as a render variable on the month column.
------------------------------
Marc Reed
Original Message:
Sent: Mon July 31, 2023 03:42 PM
From: Dn Pr
Subject: Hide a row based on a condition
Is it possible to hide a row (detail or group) based on a condition?
I have a requirement to do 2 list reports.
In one I need to hide the details without any condition
The second one needs to hide the Group based on 1 condition and then hide the details based on another condition.
Any help is greatly appreciated.
------------------------------
Dn
------------------------------