Custom Report Layout and using different company logos

wolfuliumwolfulium Member Posts: 30
Hello, I have a task to create a report (using Word). I have a company that has two different logos. The company logo is determined by the company code. The "picture" field is the main picture and the "other co picture" field is the alternate picture. What I need is for the report to pick the proper picture based on the company code.

Company Code: Co1 - Picture - Co1 Picture
Company Code: Co2 - Other Co Picture - Co2 Picture

If that makes sense. Currently in the microsoft word report, the XML mapping is set for the Picture field, but I cannot figure out how to dynamically pick the proper field.

Best Answer

Answers

  • wolfuliumwolfulium Member Posts: 30
    IF Cust."Global Dimension 1 Code" = 'OTHERCO' THEN BEGIN
      CompanyInfo.CALCFIELDS(CompanyInfo."Other Co. Picture");
      CLEAR(CompanyInfo.Picture);
      FormatAddr.Company(CompanyAddr, CompanyInfo);
    END ELSE BEGIN
      IF Cust."Global Dimension 1 Code" = 'CO' THEN BEGIN
        CompanyInfo.CALCFIELDS(CompanyInfo.Picture);
        CLEAR(CompanyInfo."Other Co. Picture");
        FormatAddr.Company(CompanyAddr, CompanyInfo);
      END;
    END;
    


    So here is the code I came up with, the bottom portion actually shows the picture. That is the default picture that is in the Picture column of the table, the first part goes through and updates the address but does not show any picture.

    So, my next question is.... does anyone know why?
  • JuhlJuhl Member Posts: 724
    Formataddress doesn't take care op the picture.
    Make a new variable and fill it with pic1 or pic2 in your code, and include the variable in the dataset, and use that instead.
    You could also overwrite the picture field I guess.
    CompanyInfo.Picture := CompanyInfo.OtherPicture;
    Follow me on my blog juhl.blog
  • KarenhKarenh Member Posts: 209
    I do work so a company that has two different trading names. Dimension 1 is used to denote the business name. Two logos are used, one on top of the other with a small offset. The logos visible property is set based on the value of dimension 1.
Sign In or Register to comment.