Hiding column if it has values = 0
Hi, I have a 10 columns table in that, on the last column(which is, Ref_Number) I want to apply condition that if it has no data i.e. if all values=0 then that column should be hidden in the output and only in case if it has any data it should be present in output. I did trying to set Column->Visibility->Show or hide based on an expression. and wrote below expression for Hidden:- =IIF(Fields!Ref_Number = 0, True, False) -But this does not seem to be working. Since I don't have any data for that column but that column is still present in output showing its column header. (note: I am having one group in table which has sub total(Ref_Number) as well so that part is also there in the column) Thanks,
January 20th, 2011 8:19pm

Hi BI_UltraDev, I think Header is printing because of "Group", can you trying removing that "Group" and see if that works. I tried without any Group, it works perfect fine. Please let us know your feedback. Thanks KumarKG, MCTS
Free Windows Admin Tool Kit Click here and download it now
January 20th, 2011 8:58pm

Hi Kumar03, I should not remove group from the table. That's not the way requirement is. BTW, group should be irrespective of this column visibility expression. Any other thought? Thanks,
January 20th, 2011 10:09pm

Hi BI_UltraDev, With Group also it should work, I tried your case and everything went successfully. I have uploaded sample example for you, try this link:- https://docs.google.com/leaf?id=0B9kG9JjPJGAvNWFiOWRlYTYtZWQyNi00MjNjLWJkNWQtMDVkNjhkZGY0Njg3&hl=en&authkey=CIDM2ugM Page3(DataSet4) and Page 4(DataSet5) are based on your query, also I have group on Page5 based Tablix. Please let us know your feedback. Thanks KumarKG, MCTS
Free Windows Admin Tool Kit Click here and download it now
January 20th, 2011 10:24pm

I think I got the key why it is not hiding it even if the expression is correct. Because, there is no data as of now for any of the field in the table (including parent group's field). So, you may want to test it on such table which has no data at all and you will notice even if your hidden expression is correct it (column header) will be shown up in the output. Interesting !!!
January 20th, 2011 10:27pm

Hi, In that case your expression should more specific:- = IIf ( Fields!Ref_Number = 0 OR IsNothing(Fields!Ref_Number) OR Fields!Ref_Number = "", True, False) Thanks KumarKG, MCTS
Free Windows Admin Tool Kit Click here and download it now
January 20th, 2011 10:31pm

Nope, it should not work with that expression as well if you don't have data at all. I already have tried that earlier and verified. Even with your modified expression column headers will be present in the output. You may want to double check it. Thanks,
January 20th, 2011 10:45pm

Hi BI, I double check your comments, and for me everything is going successfully WITH data (meaning NO column headers are printing, only values are equal to 0) OR WITHOUT data (meaning NO column headers are printing, column is empty). Also, note I have group above it as per your requirement, please find my example here:- https://docs.google.com/leaf?id=0B9kG9JjPJGAvZDA4ZmVlZmUtNjQzMS00ZTE3LTk1MzItMjgyNjVjZWM1NjQx&hl=en&authkey=CIyKqgU Please let us know your feedback. Thanks Kumar KG, MCTS
Free Windows Admin Tool Kit Click here and download it now
January 20th, 2011 11:03pm

In SSRS 2008, you have to turn on "advanced" mode for grouping. example: http://msdn.microsoft.com/en-us/library/cc281455.aspx This should be available when viewed in Visual Studio at the bottom of the report. After that is done you can access row and column data for each Tablix in the report. Click on the column you want to hide conditionally (they display in order on the right pane, rows are on left), and apply your expression to the "Hidden" property in the Properties Pane. This will cause the entire column to be hidden. Data field not present will be checked by the following expression =IIF(Fields!DummyField.IsMissing,true,false) No Rows will be checked with the following expression: =IIF(CountRows("DatasetName") = 0,true,false) zero fields would have to checked using an aggregate function on the dataset (SUM). Frank Pearson
June 22nd, 2011 1:00am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics