Click here to Skip to main content
15,041,393 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi
I'm using RDLC reports in my application.
In the body section, I have placed all the content in rectangles,
Now I want to show or hide rectangles based on some conditions.
and it should be done in code behind in C#.
I'm using "xx.aspx.cs" to handle the reports.

Can anyone please give me any approach to accomplish this.

Thanks in advance.
Sri.

[edit]Subject corrected to match body: "triangles" becomes "rectangles" - OriginalGriff[/edit]
Posted
Updated 7-Feb-11 22:05pm
v2

1 solution

There is a Visible property for every control. It says: true, false, Expression.

Choose Expression. Using it, you can put any condition using VB6 code in the expression window.
Something like:
=iif(Len(Fields!MyField.Value)>12,true,false). 
   
Comments
Sri9797 8-Feb-11 6:10am
   
Thanks Sandeep
Sri9797 10-Feb-11 6:47am
   
Sorry, I'm unable to do that. The rectangle is always hiding irrespective of that condition.
Can you explain the syntax (I'm getting confused from the part "true,false")
Sandeep Mewara 10-Feb-11 7:34am
   
Its not '.."true,false")'
Keet true, false without quotes.

If you still fail, Copy-Paste your expression here.
Sri9797 10-Feb-11 7:36am
   
I'm using true,false without quotes; jus like :
=iif(Parameters!plan.Value="Axys",True,False)
Sandeep Mewara 10-Feb-11 7:43am
   
This looks correct. Did you checked "Parameters!plan.Value" value? Place a textbox and put this in it and see what it comes.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900