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)

Conditional Visibility for Logo Image in Header NAV 2009 R2

(0) ShareShare
ReportReport
Posted on by

Hello all and thank you for taking the time to read my question. I am fairly new to this field, and am very much learning on the fly. My question involves displaying a logo for a product on a report (Sales Invoice is one in particular) if said report contains said products. This will inturn replace the default logo which currently appears when the report is ran, given there was only one line of product at the time. Products will not be combined on reports, so it is either true

The condition needs to be set off of the Item Description, more specifically looking for "ID2". I initially tried to use the IIf Function in the expression for the visibility, to which I received the error about having fields in the header. Next, I tried to add a hidden field to call in the header which I could not get to work either. As I said I am new to this site, and the field/NAV in general so any help would be greatly appreciated. 

In short:

Image 1 shows in the Header by default with Image 2 being hidden.

If Description contains "ID2" Image 2 shows and Image 1 is hidden.

Thank you again for the add, and for taking the time to look into my question.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Justin,

    What you could do is define a variable called ShowLogo and then set that value to true or false on the OnAfterGetRecord trigger of the Sales Header based on the Description and pass that value to the report and use that in the IIF condition.

  • Community Member Profile Picture
    on at

    I think this is where I am getting hung up. I created a variable IsID2Product = False on the OnAfterGetRecord, but I'm not sure how to pass it into the report and use it? If that makes sense?

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    You are using RTC report correct? You just need to add that variable in your dataset designer under Sales header Dataitem and it will appear on the RDLC side

  • Community Member Profile Picture
    on at

    Yes I am, and yes it is already in the RDLC side in the DataSet. I'm guessing the problem comes after, when trying to put it into the body of the report, and subsequently calling it in the visibility expression for the image? I added the var IsID2Product = False to the code, and that is what I'm having trouble getting into the body - and calling for the visibility.

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    You need to add that variable on the CSide and then then pass that value using the Report DataSet Designer. It is same how you get the Item Description or No. value to the report.  Why are you adding the variable in the Report Code you don't need there.

  • Community Member Profile Picture
    on at

    I added it in Design>(Blank Box highlighted)View>Global Variables>OnPreReport. Sorry, my lack of experience even hinders my ability to ask questions..which is frustrating in and of itself!

    So to be clear I need to:

    - Add the variable on the Classic(?) Side which populated it into the DataSet on the RDLC side. (Done)

    -Add variable to hidden text box from DataSet.*

    -Call variable in expression for visibility on embedded logo.*

    The * denotes what I'm not really clear on..I trust I can get the variable into the text box. From there would I call the hidden variable as the other hidden fields are - 'Code.GetData (1, 1)'  as an example - in the visibility expression?

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Ok one easy solution would be don't do the CALCFIELDS(Picture) on the CSide if it is false and you don't need any hidden expression. Just like in the report 10075 where it handles to display the logo on the right, left or middle. If you want to display the logo do CALCFIELDS else don't do the CALCFIELDS.

  • Community Member Profile Picture
    on at

    CALCFIELDS is used for calculating totals though, right? Or can it be used in this instance where we aren't working with number persay?

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    The logo you are displaying are you retrieving that from the company information? CALCFIELDS is used on flowfields and also on BLOB fields.

    Check report 10075 and see how the logo position is done, you have three different boxes but only one is shown.

  • Community Member Profile Picture
    on at

    The image is Embedded. I tried to add it to the Company Info, but am only allowed one image per in that regard.

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