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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

How to change pictures in Word-Layout with some functionality?

(0) ShareShare
ReportReport
Posted on by

Hello everybody,

I plan to do the following:

In BC I use Word layouts to display my reports. Now I have created a certificate that has a barcode. This barcode contains of course various data. Now I have found a DotNet library (OpenXML) that I can use to find images, etc. in a document. Now I thought that I could use something similar to find all pictures in a Word document in the future and possibly exchange them with a functionality, so that I don't have to create a new layout for every particular situation. Is there such a thing as an image exchange function? That I am able to replace the current barcode with a new one that contains more data. Have you ever seen or programmed something like this?

Thank you ;)

I have the same question (0)
  • JAngle Profile Picture
    152 on at

    For two situations. 1. Using the customer picture as my customer had to produce paperwork on behalf of their client. 2. Global dimension which resulted in a custom table based on company information.

    In both cases I've extended the report objects to call a code unit which then replaces the image passed from the company info table with the desired output.

    In both cases this worked for RDLC and word based layouts.

  • Community Member Profile Picture
    on at

    Ok, this sounds quite nice. Can you show me how you did this? Or is there an explanation in the Internet where the procedure is explained in detail?

  • Suggested answer
    JAngle Profile Picture
    152 on at

    So in the example with the dimensions I use the below codeunit function to convert the data to what I require. The concept is the same for a different variable like an item or a customer:

        procedure SetCompanyInformation(var CompanyInfo: Record "Company Information"; EntCode: Code[10]; var tmpEntityInfo: Record "Company Information (Entity)" temporary) Found: Boolean
        var
            InStr: InStream;
            OutStr: OutStream;
            CompanyEntity: Record "Company Information (Entity)";
        begin
    
            IF CompanyEntity.GET(EntCode) THEN BEGIN
                CompanyEntity.CALCFIELDS(Picture);
                tmpEntityInfo.TRANSFERFIELDS(CompanyEntity);
                IF tmpEntityInfo.INSERT THEN;
                CompanyInfo.TRANSFERFIELDS(CompanyEntity);
                Found := TRUE;
            END ELSE BEGIN
                CompanyInfo.GET;
                CompanyInfo.CALCFIELDS(Picture);
                tmpEntityInfo.TRANSFERFIELDS(CompanyInfo);
                IF tmpEntityInfo.INSERT THEN;
            END;
        end;

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,947 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,120 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 628 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans