Hide a column and dont show white space
-
Friday, February 15, 2013 11:15 PM
My report has a table which has these 7 static columns: Department, Week1, Week2, Week3, Week4, Week5, Total
User run the report for a period. The data retrieved for that period could be for 4 weeks or 5 weeks. The dataset has a field 'week5_include_flag' which tells me if the data is for 4 weeks or 5 weeks. If week5_include_flag = 1 then the data is for 5 weeks else data is for 4 weeks.
I want to hide Week5 column if the field 5th_week_include has value 1. That was easy as I defined this expression for the Hidden property of Week5 column:
=IIf(Fields!week5_include_flag.Value = 1, false, true)
It is working and the Week5 column is hiding correctly based on the value of week5_include_flag field. But when Week5 column is hidden, the table is showing a white space in place of Week5 column and then the Total column. That does not look good. I want to show the Total column instead of the white space just beside the Week4 column so the table looks good. How can I do that?
I am using SQL Server Reporting 2008 R2.
Thanks
All Replies
-
Saturday, February 16, 2013 2:58 PM
In that case, you should hide the total column instead the week5 column, something like this.
- In the hidden expression of the total column you can use your expression.
- In the title of the week5 column, you can use this expression =IIf(Fields!week5_include_flag.Value = 1, "Week5", "Total")
- In the data field of that column, you can use this expression =IIf(Fields!week5_include_flag.Value = 1, Fields!Week5.Value, Fields!Total.Value)
I hope this helps.
Regards
John Bocachica | Colombia | http://jboca.blogspot.com http://www.iwco.co
-
Saturday, February 16, 2013 3:02 PM
Please check this fourm discussion. Answer already explained in this discussions.
Please Mark posts as answers or helpful so that others can more easily find the answers they seek.
- Marked As Answer by Mike YinMicrosoft Contingent Staff, Moderator Monday, February 25, 2013 1:39 AM

