title: how to dynamically add images in a nested loop (in template.docx) with xdocreport and velocity
body: <p>please i want to dynamically add images in a nested loop, i use docx as template.
  i use xdocreport 1.0.2 and velocity.</p>
  
  <p>here is my code:</p>
  
  <pre><code>List&lt;Obect&gt; structureList=new arrayList&lt;Object&gt;();
  
  
  
  HashMap&lt;String, Object&gt; structureMap = new HashMap&lt;String, Object&gt;();
  
      for(Structure sutructure:structureList){
  
        List&lt;Obect&gt; orientationList=new arrayList&lt;Object&gt;();
  
        //orientation can be vertical or horizontal;
  
          for(Orientation orientation: OrientationList){
  
           HashMap&lt;String, Object&gt; orientationMap = new HashMap&lt;String, Object&gt;();
  
           List&lt;Obect&gt; projectionList=new arrayList&lt;Object&gt;();
  
                 for(integer projection: projectionList){
  
               HashMap&lt;String, Object&gt; projectionMap = new HashMap&lt;String, Object&gt;();
  
                       projectionMap.put("projectionImage",  getImageproviderByOrientationAndProjection(orientation, projection);
  
                         projectionList.add(projectionMap);
  
                }
  
       orientationMap.put("projections", projectionList); 
  
       orientationList.add(orientationMap);
  
        }
      structureMap.put("orientation", orientationList);
  
       structureList.add(structureMap);
  
     }
  </code></pre>
  
  <p>context("structures", structureList)</p>
  
  <hr>
  
  <p>//my metadata are setting like this:</p>
  
  <p>metadata.addFieldAsImage("projectionImage", "projection.projectionImage");</p>
  
  <hr>
  
  <p>in my template(.docx) i do this:</p>
  
  <pre><code> "#"foreach($structure in $structures){
  
        "#"foreach($orientation in $structure.orientations){
  
             "#"for($projection in $orientation.projections){
  
           //print image by projection
  
             }
         }
     }
  </code></pre>