tags:

views:

641

answers:

1

Hi, i need to change the visibility of a image in my report. For that i'm using an expression. For default i want it set to true, and when i'm printing i set the parameter to false so the image doen't show up. Problem is, image never show's up.

=CBool(Parameters!ShowImage.Value)

c# (the parameter i send when creating the report)

. . p[27] = new ReportParameter("ShowImage", "True"); this.reportViewer1.LocalReport.SetParameters(p);

Thanks in advance

A: 

You're setting the Hidden property of the control in the RDLC right?

Try =(Parameters!ShowImage.value="False")

hawbsl
Does not work =(right now i'm setting in tab visibility:Expression: =CBool(Parameters!ShowImage.Value)i tried =True, image doesn't show up either..
Sarev0k
What does the RLDC file look like in XML?you should see something like: <Visibility> <Hidden>=(Parameters!ShowImage.Value="False")</Hidden> </Visibility>
hawbsl
<Image Name="image1"> <Sizing>Fit</Sizing> <Visibility> <Hidden>=CBool(Parameters!ShowImage.Value)</Hidden> </Visibility>
Sarev0k
ok, i changed the xml to (Parameters!ShowImage.Value="False"). Now it shows the image (like i want). But when i print, it does not hide the image. How i'm doing it:private void reportViewer1_Print(object sender, CancelEventArgs e) { ReportParameter[] p = new ReportParameter[1]; p[0] = new ReportParameter("ShowImage", "True"); this.reportViewer1.LocalReport.SetParameters(p); }
Sarev0k
hawbsl thanks for your help :) The main problem was that i was setting the parameter in the wrong place (i went to properties, visibility, expression).
Sarev0k
glad it was solved
hawbsl