Add image to Word template from entity

How to I put images from entity (attachment) into Word template. I see that the templates has the option to put values into word by ref fields in Word including tables, but how do I do it with images.

This is an important argument to convince management that Cuba Platform is a suitable alternative to Lotus Notes.

  • It must be possible to insert a picture or pictures either under each other or two or three in width and in several rows. Everything must be obtained from entities or via SQL
1 Like


You have several options to show images in DOCX files.

  1. If you store your attachments in CUBA file storage, you can use ${imageFileId:WxH} format. You need to select FileDescriptor id in you SQL, and set the format for the field. Make sure you use full name of field (BandName.FieldName) in the format.

  2. If you store you attachments as bytes in database column, you can use ${bitmap:WxH} format. Just select the field with SQL and set the format.

  3. If you have URLs, referencing to you attachments, you can use ${image:WxH} format. Just select URL string in SQL and set the format.

Please let me know if you have some troubles.