Options

Switching Pictures

AlxAlx Member Posts: 38
Hi everyone!

I have a Report that prints in 2 languages. My company logo which is printed on the report also comes in 2 languages. I have added a field of type BLOB to the Company Information table and I have imported my English logo into that field, called "Picture ENU".
I try to programmatically change the logo:

CurrLangCode := Language.GetUserLanguage;
IF CurrLangCode = 'ELL' THEN BEGIN
"Company Information".CALCFIELDS(Picture);
CompanyLogo := "Company Information".Picture;
END ELSE BEGIN
"Company Information".CALCFIELDS("Picture ENU");
CompanyLogo := "Company Information"."Picture ENU";
END;

The problem is that I can't get this code compiled, because I can't define a Global (CompanyLogo) of type BLOB.
Is there a datatype I COULD use, or any other workarounds?

Thanx,

Alx

Comments

  • Options
    Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Put one logo in the other logo field of the company table and don't modify the table.

    
    Compinfo.blob1 := compinfo.blob2;
    
    
    
    Use this logo in the sourceexpr.
  • Options
    AlxAlx Member Posts: 38
    This is the code that finally worked:

    CurrLangCode := Language.GetUserLanguage;
    IF CurrLangCode = 'ELL' THEN
    "Company Information".CALCFIELDS(Picture)
    ELSE BEGIN
    "Company Information".CALCFIELDS("Picture ENU");
    "Company Information".Picture := "Company Information"."Picture ENU";
    END;

    :D

    Thanx Mark!
Sign In or Register to comment.