Thread: Watermark in RTF template....


Permlink Replies: 21 - Pages: 2 [ 1 2 | Next ] - Last Post: Nov 17, 2008 9:39 AM Last Post By: user10590491
user531037

Posts: 37
Registered: 09/15/06
Watermark in RTF template....
Posted: Sep 15, 2006 10:19 AM
Click to report abuse...   Click to reply to this thread Reply
Hi XMLP Gurus,

Is it possible to code watermark in XMLP by inserting a field and coding the condition in that field. Depending on the condition I can print the watermark text on the output. Is this achievable?

Thanks in advance...
Tim Dexter

Posts: 2,261
Registered: 01/10/01
Re: Watermark in RTF template....
Posted: Sep 19, 2006 12:33 AM   in response to: user531037 in response to: user531037
Click to report abuse...   Click to reply to this thread Reply
Yes, it is. In the RTF template you can create a variable, use the variable name in the MSWord watermark support e.g. $wMark and then assign it the watermark value at runtime. check the user guide for watermark details.
Regards, Tim
user531037

Posts: 37
Registered: 09/15/06
Re: Watermark in RTF template....
Posted: Sep 20, 2006 4:33 PM   in response to: Tim Dexter in response to: Tim Dexter
Click to report abuse...   Click to reply to this thread Reply
Hi Tim,

Thanks for your response.
As I am new for XLMP, I am unable to pass value in the variable.

I have created a variable in the field and passed that variable( <?$WATER_M?> ) to the text field in MSWord water mark support.
<xsl: variable name = "WATER_M">

Now below this I am trying to code my condition say:
<?xdofx:if (C_ORDER_NUMBER) = 12345 then $WATER_M = 'MY ORDER' end if?>

but it is not working.
I think the syntax I am using to pass value to the variable when the condition is met is wrong. It should print "MY ORDER" as the water mark when the condition is met.

Can you please correct the syntax.

Thanks again.
user590282

Posts: 7
Registered: 08/16/07
Re: Watermark in RTF template....
Posted: Aug 16, 2007 4:44 AM   in response to: user531037 in response to: user531037
Click to report abuse...   Click to reply to this thread Reply
Hi,

Did you got any solution to this. Let me know if you have any solution as i need it very urgent.

Regards,

Hari.
Tim Dexter

Posts: 2,261
Registered: 01/10/01
Re: Watermark in RTF template....
Posted: Aug 16, 2007 7:39 AM   in response to: user531037 in response to: user531037
Click to report abuse...   Click to reply to this thread Reply
Hi
XSL variables are not like say plsql variables, they behave more like constants ie you assign it an initial value and thats it.
USe the XMLP updatable variables, see the user guide for more details
Tim
RPP

Posts: 10
Registered: 10/20/07
Re: Watermark in RTF template....
Posted: Nov 5, 2007 5:28 AM   in response to: Tim Dexter in response to: Tim Dexter
Click to report abuse...   Click to reply to this thread Reply
I'm also trying to include a watermark in my rtf that would need to be conditional. Regarding the XMLP variables, do we have an example that is compatible with the MS Word watermark text field? There are plenty of Java references the user guide, but I didn't see an example from RTF.

I can get Word to pick up an XSL variable, but can't get any IF logic to work around it. Using a set_variable and get_variable also doesn't appear to work so well from a Word watermark perspective (Word didn't successfully do the get_variable when running from Word Format->Background->Watermark->Text).

Thanks,

RPP

Message was edited by:
user601336

RPP

Posts: 10
Registered: 10/20/07
Re: Watermark in RTF template....
Posted: Nov 7, 2007 6:06 AM   in response to: RPP in response to: RPP
Click to report abuse...   Click to reply to this thread Reply
Here is the code I'm using to assign the Word Watermark:

<xsl:variable name="wMarkCancel" select="'CANCELED'"/>

<?if: /PO_DATA/CANCEL_FLAG="Y"?>
<xsl:variable name="wMark">
<xsl:value-of select="$wMarkCancel"/>
</xsl:variable><?end if?>


And the value in MS Word in the Watermark Textbox (nav from MS Word: Format->Background->Printed Watermark->Text Watermark):


<?$wMark?>


Any thoughts or suggestions on how to only get the watermark to appear when a flag is set?

Thanks,

RPP
Tim Dexter

Posts: 2,261
Registered: 01/10/01
Re: Watermark in RTF template....
Posted: Nov 7, 2007 6:45 AM   in response to: RPP in response to: RPP
Click to report abuse...   Click to reply to this thread Reply
Hey RPP

Apologies, I'll takre a look see and get back to you. I have a feeling the watermark value will get evaluated before your 'if' code is so it will always be the default value.
I'll check it out.

Tim
RPP

Posts: 10
Registered: 10/20/07
Re: Watermark in RTF template....
Posted: Nov 8, 2007 7:53 AM   in response to: Tim Dexter in response to: Tim Dexter
Click to report abuse...   Click to reply to this thread Reply
Tim,

I kind of have that impression as well. It looks like the watermark is preprocessed and any if logic wrapped around it is simply ignored, but there has to be a way. Having a watermark that will display when the purchase order is canceled seems like a fairly common requirement. Surely this can't be the first time this functionality has been requested?

Thanks,

RPP
RPP

Posts: 10
Registered: 10/20/07
Re: Watermark in RTF template....
Posted: Nov 14, 2007 3:40 AM   in response to: RPP in response to: RPP
Click to report abuse...   Click to reply to this thread Reply
Tim,

Would you have any suggestions?

Thanks,

RPP
RPP

Posts: 10
Registered: 10/20/07
Re: Watermark in RTF template....
Posted: Nov 20, 2007 5:20 AM   in response to: RPP in response to: RPP
Click to report abuse...   Click to reply to this thread Reply
Tim,

Are you still looking at this?

Thanks,

RPP
Tim Dexter

Posts: 2,261
Registered: 01/10/01
Re: Watermark in RTF template....
Posted: Dec 6, 2007 2:23 PM   in response to: RPP in response to: RPP
Click to report abuse...   Click to reply to this thread Reply
Hi Roc

Apologies

I have come up with a solution that I think will work for you. Its using an if statement but its a new or should I say one that we have not documented yet.

<xsl:variable name="wMark" select="xdoxslt:ifelse(.//WM_FLAG='C’,'Canceled','Approved')"/>

I have a single variable wMark and I then use the ifelse statment

thi sis check the value of the WM_FLAG element, if its a 'C' then assign Canceled otherwise assign Approved to the wMark variable

I then have a text watermark

<?wMark?>

See attached template and XML

Will blog this and other watermarking stuff on Monday

Tim
RPP

Posts: 10
Registered: 10/20/07
Re: Watermark in RTF template....
Posted: Dec 7, 2007 5:34 AM   in response to: Tim Dexter in response to: Tim Dexter
Click to report abuse...   Click to reply to this thread Reply
Tim,

Thanks very much, it works very well for me, and I'll probably frequently use that ifelse functionality as well.

RPP
user607510

Posts: 22
Registered: 11/26/07
Re: Watermark in RTF template....
Posted: Jan 2, 2008 4:52 AM   in response to: RPP in response to: RPP
Click to report abuse...   Click to reply to this thread Reply
Hi Tim,

I have used the above code that you have mentioned for watermark but it is not working properly. Actually the XSL variables behave like constants. so, once the if condition is evaluated first time, the first value 'CANCELED' will be there in 'wMark' variable.. and it is not getting updated. i think we need to use updatable variables..

If the above code worked for any one. please tell me clearly how did it work and what was the code exactly. I need it very badly.

Thanks
KV
RPP

Posts: 10
Registered: 10/20/07
Re: Watermark in RTF template....
Posted: Jan 2, 2008 5:10 AM   in response to: user607510 in response to: user607510
Click to report abuse...   Click to reply to this thread Reply
KV,

The ifelse statement Tim suggested worked fine for me. Here's the actual code I have for a dynamic watermark:

<xsl:variable name="wMark" select="xdoxslt:ifelse(/PO_DATA/CANCEL_FLAG='Y’,'Canceled','')"/>

My code only assigns "Canceled" to the watermark if the flag is set to "Y" and leaves the watermark blank otherwise.

The other Choose and If-Else statements didn't work, but this one does. This is the only example of an xsl variable I've seen where the variable does not behave like a constant and is dynamic (though, technically, the wMark variable is assigned only once in the code).

RPP
Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums