Hide PictureBox Issue

2 posts, 0 answers
  1. Sanjaya Kodagoda
    Sanjaya Kodagoda avatar
    10 posts
    Member since:
    Mar 2006

    Posted 11 Oct 2014 Link to this post

    Hi Guys,

    I'm new to reporting and there is a requirement to display an image in my report and I'm using a picture box for this. 

    Problem I have is I want to display this image only when it is available. From my dataset I'm returning the image path(this will always return a path if image is present or not) and a boolean value indicating if the image is present. 

    So I tried adding an conditional formatting rule to picture box defining layout should not be visible when the Field.ImageAvailable property is false. But when I render the report, it displays image not found error.

    So have I missed anything or is there any other way to handle this?

    Thanks in advance!!
  2. Hinata
    Hinata avatar
    146 posts
    Member since:
    Dec 2013

    Posted 15 Oct 2014 in reply to Sanjaya Kodagoda Link to this post

    Hi Sanjaya,

    All invisible/hidden report items will also be processed by the reporting engine.
    This means the picturebox will generate a visible error when you pass an invalid image path to it, even though it is set to be invisible.

    To handle this better, in addition to the conditional formatting you should pass the value path in the expression conditionally. Something like the following expression:

    PictureBox.Value = "= IIf(Fields.ImageAvailable = True, Fields.ImagePath, Null)"
Back to Top