web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Image Visibility

(0) ShareShare
ReportReport
Posted on by 4,824

Hi expert, I created an Option variable with two strings A, B and added to the request page of the report. In the RDLC, I uploaded two images(A, B) and set the image property embed and visibility to hide. In the hide value, I have the following code:

=Switch(Fields!image.Value=1,"A",
        Fields!image.Value=2, "B")

When I ran the report and selected the option A(not sure why it is not displaying as option button, but instead it showed the dropdown list A, B), Image A didn't show (

only showed icon of missing image). But when I selected B from the dropdown list, it showed image B perfectly. I tried to switch A & B, but this time image B which was A on the first testing didn't show on the report (only showed the icon of  missing image). When I selected B (It was A on the first test), the image showed perfectly.

Why does it not work for the first dropdown item in my case? I need your professional advice. Thank you very much!

*This post is locked for comments

I have the same question (0)
  • Saurav.Dhyani Profile Picture
    14,380 Super User 2025 Season 2 on at

    Hi Snoopy,

    Your Statement was quite confusing but please find below as per my understanding -

    a) Option field are shown in report as you see them.

    b) why are using embedded report, I am not sure about it.

    c) I tried using database image and it worked fine with me. Here is what I did -

      1. added one more field say picture 2 in company information and added same to page.

      2. imported the image from the company information card.

     3. Created a report based on company information. Used calcfields to get values of images.

    4. Create a option variable as you said.

    5. created three images in visual layout.

    6. 1 image have  -

        Source Expr -  =First(Fields!Picture_CompanyInformation.Value,"DataSet_Result")

       Visiblity - =IIF(Fields!MyOption.Value ="A",False,TRUE)

    6. 2 image have  -

        Source Expr -  =First(Fields!Picture2_CompanyInformation.Value,"DataSet_Result")

       Visiblity - =IIF(Fields!MyOption.Value ="B",False,TRUE)

     

    6. 3 image have  -

        Source Expr -  =IIF(Fields!MyOption.Value = "A",First(Fields!Picture_CompanyInformation.Value, "DataSet_Result"),First(Fields!Picture2_CompanyInformation.Value, "DataSet_Result"))

       Visiblity - SHOW.

    It works fine. I don't know what is the issue that you have.

    You can find related objects from my skydrive folder [NAV 2013]. Here is the link -

    https://skydrive.live.com/redir?resid=145E2738BACE1FB2!216

     

    Let me know if you require any further information.

  • snoppy Profile Picture
    4,824 on at

    Thank you expert! I tried exactly as you said, but only B logo showed no matter what option I selected. I tried to study your sample. But after importing the object, I cannot run it and it displayed the error of that I didn't have the right. Please advise! Thank you!

  • Saurav.Dhyani Profile Picture
    14,380 Super User 2025 Season 2 on at

    Hi Snoppy,

     

    Renumber the Report object to your licensed Range. May be somewhere in 50000.

     

    Let me know if any issues.

  • snoppy Profile Picture
    4,824 on at

    Hi expert, I cannot do anything. renaming, opening etc.  Thank you!

  • Saurav.Dhyani Profile Picture
    14,380 Super User 2025 Season 2 on at

    Hi,

    Can you tell me a free Report ID in your Permitted Range. I will re-number and re-send it to you.

  • snoppy Profile Picture
    4,824 on at

    Hi expert! Thank you for your kind reply and help! How about 50050? BTW, I have imported the object you gave to me, but I cannot delete it from the system now. Is there any way to remove it? Thank you!

  • Suggested answer
    Ole Binder Profile Picture
    5 on at

    I have another way, I use to insert different Pictures in an invoice header:

    First create a global record variable - FirmaTmp (Rec=Company) and set property to temporary.

    OnAfterGetRecord:

    IF COMPANYNAME = 'CompanyXXX' THEN FirmaTmp.Picture.IMPORT(Drive+':\Logo\XXX.bmp');

    IF COMPANYNAME = 'ITG Hosting A/S' THEN FirmaTmp.Picture.IMPORT(Drive+':\Logo\itghosting.bmp');

    --------------------

    With this code you dont have to chance the company-record.

    Maybe you can use this.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans