0 Replies Latest reply on Aug 7, 2014 1:28 PM by Diego Chareca

    E1 BIP - How can I print multiple copies of RTF template based on a tag value?

    Diego Chareca


      Working with E1 BIP, I need to generate several copies of a RTF template, based on a value included in the xml source. That means, I don't have the number of copies pre-defined, but I have it dinamically defined depending on the value of a tag. See in the example attached, that I have the tag <Total_of_Quantity___By_Item_ID1> with value equal to 2. So, I need 2 copies of the RTF template. The xml has specific product information that needs to be printed in a label and then, stick those labels to the containers, the number of containers are defined in that tag, that''s why I need several copies of the same layout.


      I thought I could use the foreach_number, as follows, defining a numeric variable nCopies, and assigning the tag value to that variable. Then, I'm using the variable nCopies in the foreach_number to loop the layout (label), as many times as defined in that variable. However, the resulting PDF does print that number of copies, but it does not show any value included in the tags inside the layout (e.g.<ItemNumber_ID28>), as if the BIP engine is somehow loosing the reference to the outside foreach:



      for-each (defined for <On_Item_Number__Short__S4> section)

      <?xdoxslt:set_variable($_XDOCTX,’nCopies’, Total_of_Quantity___By_Item_ID1)?>

      <?for-each:xdoxslt:foreach_number($_XDOCTX,1, xdoxslt:to_number(xdoxslt:get_variable($_XDOCTX, ‘nCopies’)),1)?>

      *** Here you have the label with product information ***





      <?end for-each?>



      How can I solve this issue?