We have a requirement, where an Invoice batch job will run
at night and pick up all the entire invoices, batch would contain invoices of
Each customer will have DFF at site level informing number
of copies required to be printed.
Customer ABC Invoice ABC111 No. of Copies -4
Customer PQR Invoice PQR222 No. of Copies -2
Customer XYZ Invoice XYZ3333 No. of Copies -1
I am trying to use following variable in the RTF, for the data to loop but it creates various problems
Grouping and Variables:
<?for-each@section:xdoxslt:foreach_number($_XDOCTX,1,DFF,1)?> --- value coming in XML tag from DFF
The actual invoice tables and rtf
b.) When I try with a data containing just single invoice – looping and everything works as expected.
However, if I load data which has multiple invoices each having different value in DFF for looping, entire file only contains first invoice ---- Looping happens still but does not proceed to next group
Can someone please guide me to the solution?
Please recommend what would be the correct syntax, so that each invoice gets looped dynamically in the RTF.
Here's the dataset I used and tried to replicate what you were trying to achieve:
Here's the code:
So based on the count, there are 3 pages where A (from ITEM field) is printed and 5 pages where B is printed.
Hope this helps.
Thanks a lot for the prompt reply.
I guess, I was missing setting the variable in context <?variable@incontext:G1;current()?>. This has really been helpful and I am able to get the data to repeat as expected.
However, this has lead me another tricky position. As mentioned I am trying looping for Invoice data, which has 2 groupls Parent Group Header and Child Group it's Lines.
When, I use the above method I am able to get header part of invoice repeat - but initally lines data would come blank.
So just before opening the Lines Group in RTF, I introuduced <?for-each:/?> (which would set to currrent level) - But this method prints Lines not only for current invoice header but lines corresponding to all the invoices in the file.
To sum it up, I am able to get invoice header to repeat based on Count, but the lines data always is exactly same for entire file.
Guess, RTF is not able to close the Lines group before starting looping again.
Can you please advise, some syntax I might be missing.
Thanks a lot.