reportvtlmagic-draw

Printing the Image of the actors in the DOCX report file


I'm using a DOCX template with VTL snippets to generate my MagicDraw 2021x Use Case model report. For unknown reason I can't print the image of some actors in the model. What might be the reason for this?

It tried this snippets :

#macro(createActorContent $actor)
#increaseIndent()
#writeBook markHeader($actor, $actor.HumanName)


ACTOR IMAGE
$actor.name.Image
$actor.name.image

$actor.Image
SC IMAGE
$actor.Namespace.image`
#end

Solution

  • I'm in the process of figuring this out as well, so hopefully there are better answers than mine. It looks like in your sample you don't call $actor.image [notice the lowercase leading 'i' in image]. I'll add in a script I'm working with now to display an attached custom image instead of a diagram screenshot. It runs and works but is looking for 'system' typed blocks not actors. My understanding is the 'image' attribute works the same on both types of element.

    System enumeration
    ForEach(System) ##'header' used to debug output
    #foreach($system in $System) ## for each system in the list of systems
    System: $system.name ## print the system.name
    Image: $system.image ## insert the system.image (this can be NA if the image field is not set or the block is not used in a diagram). I haven't figured out how to load a custom image (like a png attached to the element).
    Doc: $system.documentation ## prints documentation field
    #end