Generate this example Choose a template and create a fresh report with the demo service.

xtt->merge( iv_block_name = 'R' is_block =

JSON
{"TITLE":"Test icons","T":[{"ID":"@00@","NAME":"ICON_DUMMY","IMG":"REF UNSUPPORTED","RAW":""},{"ID":"@01@","NAME":"ICON_CHECKED","IMG":"REF UNSUPPORTED","RAW":""},{"ID":"@02@","NAME":"ICON_INCOMPLETE","IMG":"REF UNSUPPORTED","RAW":""},{"ID":"@03@","NAME":"ICON_FAILURE","IMG":"REF UNSUPPORTED","RAW":""},{"ID":"@04@","NAME":"ICON_POSITIVE","IMG":"REF UNSUPPORTED","RAW":""},{"ID":"@05@","NAME":"ICON_NEGATIVE","IMG":"REF UNSUPPORTED","RAW":""},{"ID":"@06@","NAME":"ICON_LOCKED","IMG":"REF UNSUPPORTED","RAW":""},{"ID":"@07@","NAME":"ICON_UNLOCKED","IMG":"REF UNSUPPORTED","RAW":""},{"ID":"@0B@","NAME":"ICON_TOTAL_LEFT","IMG":"REF UNSUPPORTED","RAW":""},{"ID":"@0C@","NAME":"ICON_TOTAL_RIGHT","IMG":"REF UNSUPPORTED","RAW":""},{"ID":"@0D@","NAME":"ICON_COLUMN_LEFT","IMG":"REF UNSUPPORTED","RAW":""},{"ID":"@0E@","NAME":"ICON_COLUMN_RIGHT","IMG":"REF UNSUPPORTED","RAW":""},{"ID":"@0F@","NAME":"ICON_PAGE_RIGHT","IMG":"REF UNSUPPORTED","RAW":""},{"ID":"@0G@","NAME":"ICON_PAGE_LEFT","IMG":"REF UNSUPPORTED","RAW":""},{"ID":"@0H@","NAME":"ICON_PREVIOUS_VALUE","IMG":"REF UNSUPPORTED","RAW":""}]}

).


Generate demo 100

Images

Request preview

Purpose

Demo ZCL_XTT_DEMO_100 replaces image placeholders in XLSX, DOCX, Word XML, and PDF templates. Use a placeholder whenever the template controls the frame, size, position, border, or other presentation details.

For a fixed number of images, create empty placeholders and replace their binary content at runtime. XML formats commonly embed image data as Base64; Office Open XML stores images as package parts.

Create an image in ABAP

For a simple rectangular image, expose it like any other report field.

image

Use one ZCL_XTT_IMAGE instance per generated picture:

 img  TYPE REF TO zcl_xtt_image, " <--- IMAGE

At minimum, pass the binary content as IV_IMAGE TYPE XSTRING.

    " Create new instance
    <ls_icon>-img = zcl_xtt_image=>create_image( iv_image  = lv_image ).

Optionally provide the file extension and dimensions.

    " Create new instance
    <ls_icon>-img = zcl_xtt_image=>create_image( iv_image  = lv_image
                                                     iv_ext    = '.gif'
                                                     iv_width  = lv_width
                                                     iv_height = lv_height ).

Use a styled placeholder

Keep visual properties in the document template rather than encoding format-specific styling directives in a marker. XTT replaces the image content and preserves the placeholder’s presentation.

Excel

You can identify an image through its alternative text, but this is difficult for a template maintainer to discover. image

Naming the shape after the ABAP field makes the mapping easier to inspect.

image

The clearest option is to place the field marker in the same cell as the image placeholder. image


Excel

image


Word

Word also supports alternative text, bookmarks, and hyperlinks, though each can be easy to miss during maintenance. image

Using a visible note makes the marker easier to find. image


Word

image


PDF

In Adobe LiveCycle Designer, convert the placeholder to an Image field. image

The marker may be assigned in the XML Source view. image

Alternatively, store it in the URL property, noting that this mapping is less visible to the template editor.

image


Pdf

image