RDLC, Parameter-based Dynamic Picture, C #

Can a dynamic image be added to a parameter in an rdlc report? eg:

=SWITCH(Parameters!picture.Value="1","picture1.jpg", Parameters!picture.Value="2","picture2.png") 

or something similar?

or in any other way use the parameter value for guidance for a dynamic image?

+6
c # dynamic parameters image rdlc
source share
2 answers

Yes it is possible. See this blog post for a good explanation.

In short, do the following:

  • Set the Source image property to External
  • Set the Value property to an expression of type =Parameters!PathToPicture.Value for the image =Parameters!PathToPicture.Value
  • Set the EnableExternalImages property of the ReportViewer or LocalReport to true
+10
source share

You can set the parameter value as the path to the selected image. Then simply set the Image Source to External. There are other ways; if not, just say so.

0
source share

All Articles