0 Replies Latest reply: Aug 7, 2014 8:28 AM by 2682142 RSS

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

    2682142

      Hi,

      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 ***

      <ItemNumber_ID28>

      <LotNumber_ID32>

      <ControlNumber_ID30>


      <?split-by-page-break:?>

      <?end for-each?>

      end

      ===========================================================================================


      How can I solve this issue?

       

      Thanks!
      DIego