Report change properties in C/AL

creed666creed666 Member Posts: 21
Hi,

After many search on this forum, i don't find what i'm looking for. I want to be able to change the "Visible" properties on a picture that i put in my report. I want to to this by the code.

IF A = TRUE THEN PICTURE VISIBLE
IF A = FALSE THEN PICTURE INVISIBLE

Someone can tell me how to do that

Thanks !!

Comments

  • nvermanverma Member Posts: 396
    since its for a report, why dont you create another section (like a body or something) of a report with just the picture...so if A is true, then only make that section visible...therefore, when its not true, report will ignore that section... 8)
  • ara3nara3n Member Posts: 9,256
    This is for classic report? usually the source expression is a blob and you need to do calcfields, You can add your code to calcfields or not and the picture will not print.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • SavatageSavatage Member Posts: 7,142
    ara3n wrote:
    This is for classic report? usually the source expression is a blob and you need to do calcfields, You can add your code to calcfields or not and the picture will not print.
    :thumbsup: used many times
  • creed666creed666 Member Posts: 21
    Thanks for the answer.

    Is it possible to do that with an Image object or a Picture Box ???
  • SavatageSavatage Member Posts: 7,142
    Works great with a picturebox - Did you try it? What have you tried?

    It's a simple process. If your "condition to show picture" = true then
    calcfields("your picture") else Not! then it will either show or not show.
    that's what you said you were looking for:
    IF A = TRUE THEN PICTURE VISIBLE
    IF A = FALSE THEN PICTURE INVISIBLE

    if A := ture then calcfields("your picture");

    We have also used it to import dynamicly a diff pic per record on a report, example below
    IF EXISTS ('I:\'+"Sales Header"."External Document No."+'.BMP') THEN BEGIN
      CLEAR(ShipSetup."Japanese Address Pic");
      ShipSetup."Japanese Address Pic".IMPORT('I:\'+"Sales Header"."External Document No."+'.BMP',FALSE);
      ShipSetup.CALCFIELDS("Japanese Address Pic");
    END ELSE BEGIN
      CLEAR(ShipSetup."Japanese Address Pic");
    END;
    
Sign In or Register to comment.