Image resources in reports

When I was playing around with images and resources in AX, I have found that Menu nodes have an AOT property called NormalImage. On this property you can provide a file name which was imported into AX under the Resource node, so your module would have this image shown in the Main menu.

But when you want to use the resource in a report, the kernel does not associate your custom image with a resource ID, and you also do not have a property similar to the menus.

The only solution that you have is to add a Bitmap control to your report, then read out the data that is being stored under the node and return the container as a Bitmap value. Here is the code:

display Bitmap footerImage()

    return SysResource::getResourceNodeData(SysResource::getResourceNode('WIK_MyFooterImage'));

Then you just have to pick the footerImage as your DataMethod on the Bitmap control, it is easy like that.

Labels: , , ,