6
Answers

[Resolved] Hide an image based on a parameter in RDLC Report

Andrew

Andrew

13y
18.2k
1

I have a .RDLC report file which has a table with 14 rows, 4 columns. The fourth column is an image which is set at design time.
One of the parameters stores values which indicate if the image should be displayed or not, here is the expression I use to set if the image is hidden or not
[code]=IIf(Parameters!Services.Value.ToString().Contains("6a"), false, true)[/code]
The 6a part is different for each view (1, 2a, 2b etc...)
My problem is if the code sets the image to hidden (true) then the border of the table cell is hidden also, which makes the report look less professional.
I have checked the XML of the RDLC file and can see that it treats the image as an image, and not as a table cell with an image in it.
So, is there anyway I can still hide the image based on the logic, but keep the border/have an empty cell?
Thanks,
Andrew
Answers (6)