• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

Bi Publisher Multiple Copies and WaterMarks (again)

rosieland

Member
I give on this one! I have read several sources including a post here (5/5/2012 -jaynz), type it in and get 3 blank page, replacing the &LT etc. I assume this is from looping three times. Can somebody help me? I have attachments of my R5542565 XML, and 2 .rtf's with one more abbreviated than other). I would also appreciate if you could added the code for three different watermarks for the copies. (Want this collated by each invoice). Thanks for assistance. rgschwartz@landolakes.com
 

Attachments

rosieland

Member
I want 3 copies of each invoice in collated order, INV1, INV1, INV1, INV2, INV2, INV2, INV3, INV3, INV3. Copies to have different watermark on each copy (customer, original, driver). thanks!
 

gurpreet

Member
Hi,

I tried some different methods but not able to print the invoice in collated order as you mentioned.But getting the output in this way INV1,INV2,INV3(With Customer watermark), INV1,INV2,INV3(With Original watermark) and then INV1,INV2,INV3(With Driver watermark).

Regards,
Gurpreet Singh
 

rosieland

Member
Gurpreet, Can you reply and attach what you have for the what you have done for the wrong collated order. It may give me a hint of where to go from here. Thanks, RS
 

gurpreet

Member
Hi,

Sorry for late reply.I am attaching the modified template for your reference.

Here the code i have used.
<?for-each@section:xdoxslt:foreach_number($_XDOCTX,1,3, 1)?>
<?variable@incontext:wMark;xdoxslt:ifelse(position()=2,’Original’, xdoxslt:ifelse(position()=3,’Driver’,’Customer’))?>
<?end for-each?>
<?for-each@section:/Absolute Path/On_Payment_Terms_S3?>
<?your template?>
<?end for-each?>

Then in watermark
<?$wMark?>

Thanks
Gurpreet Singh
 

Attachments

Last edited:

gurpreet

Member
Hi Rosieland,

If you find some workaround for this issue please post it here.I m also working on the same requirement as your's, But still no success.


Thanks,
Gurpreet Singh

 

ashwin E1

Active Member
Hi,

Sorry for late reply.I am attaching the modified template for your reference.

Here the code i have used.
<?for-each@section:xdoxslt:foreach_number($_XDOCTX,1,3, 1)?>
<?variable@incontext:wMark;xdoxslt:ifelse(position()=2,’Original’, xdoxslt:ifelse(position()=3,’Driver’,’Customer’))?>
<?end for-each?>
<?for-each@section:/Absolute Path/On_Payment_Terms_S3?>
<?your template?>
<?end for-each?>

Then in watermark
<?$wMark?>

Thanks
Gurpreet Singh
Hi Gurpreet,

I'm having a similar requirement, but instead of watermark it is just a heading, so I just used ur code and it work perfectly fine, but I had another requirement that the heading be made as Dynamic, so I used a variable instead of Constant as show below:

<?for-each@section:xdoxslt:foreach_number($_XDOCTX,1,3, 1)?>
<?end for-each?>
<?for-each@section:/Absolute Path/On_Payment_Terms_S3?>
<?variable@incontext:wMark;xdoxslt:ifelse(position ()=2,’DocumentOrder_ID37’, xdoxslt:ifelse(position()=3,’DocumentOrder_ID37’,’BPREX_ORDER_NO_ID330’))? >
<?template?>
<?end for-each?>

Then in Heading
<?$wMark?>

This made my heading as blank and then in the same code i replaced the Variables with any constant ans it works fine.
Can you please help with this.

Thanks,
Ashwin
 

gurpreet

Member
Hi Ashwin,
This issue beacause variables are not able to get the scope/context because of 2 for-each@section in the code. We need to use xpath for this.

XPATH: - https://www.w3schools.com/xml/xpath_syntax.asp

Please try the below methods.
1. Remove the single quotes(') from variables and prefix your variables with "//".
e.g. <?variable@incontext:wMark;xdoxslt:ifelse(positi on ()=2,//DocumentOrder_ID37, xdoxslt:ifelse(position()=3,//DocumentOrder_ID37,//BPREX_ORDER_NO_ID330))? >

But there is issue with this method, suppose we have multiple sections(in this case we have "On_Payment_Terms_S3") variables will always refer to context of first parent section and always print the same values.

2. To overcome the above issue,we need to create a variable to get the current context which will tell our variables to refer which parent node.
<?for-each@section:xdoxslt:foreach_number($_XDOCTX,1,3, 1)?>
<?end for-each?>
<?for-each@section:/Absolute Path/On_Payment_Terms_S3?>
<?variable@incontext:c;.?>
<?variable@incontext:wMark;xdoxslt:ifelse(positi on ()=2,$c/DocumentOrder_ID37, xdoxslt:ifelse(position()=3,$c/DocumentOrder_ID37,$c/BPREX_ORDER_NO_ID330))? >
<?template?>
<?end for-each?>

Then in Heading
<?$wMark?>

Hope above solution works for you.

Thanks
Gurpreet
 
Last edited:

pratz17

Member
I have used the same code

<?for-each@section:xdoxslt:foreach_number($_XDOCTX,1,3, 1)?>
<?for-each@section:/Absolute Path/On_Payment_Terms_S3?>(My code for this)
<?end for-each?>
<?end for-each?>

but i am getting 3 blank pages in output and no data in those 3 pages.
Any suggestions.

Thanks in advance.
 

johnd

Active Member
Just adding this for future readers.

A simple solution is to simply REPEAT the template and add a page break, or get MS word to do it

In this example for every AddressNumber_ID1, it prints and page breaks and prints again for every Address Book section in the XML


<?for-each:Address_Book_One_Line_Report_S2?>
<?AddressNumber_ID1 ?>
<?split-by-page-break:?>
<?AddressNumber_ID1?>
<?split-by-page-break:?>
<?end for-each?>
 
Top