Thursday Apr 11, 2013

Variable Numbers to Words

Satyender posted a comment to the Numbers to Words post asking:
How can I store the result of <?xdofx:to_check_number(TOTAL_INV_AMOUNT,'USD','CASE_UPPER','DECIMAL_STYLE_WORDS')?> inside a variable.

Checking this out, BIP chokes on the assigning to the variable with a nice error:

 Namespace prefix 'xdofx' used but not declared

Turning to BIP RTF template guru in residence Hok-Min, he suggested avoiding the xdofx: wrapper altogether in this case and calling the function more directly. The underlying function in java is:

public static String toCheckNumber(String locStr, String amount, String preOrCurCode, String caseStyle, String decimalStyle)

Applying that to Satyender's needs we end up with:

<?variable@incontext:salval; xdoxslt:toCheckNumber($_XDOLOCALE,.//SALARY,'USD'
,'CASE_UPPER','DECIMAL_STYLE_WORDS')?>

We still need the xdoxslt prefix but we can now assign the value to a variable. There is a caveat from Hok Min.

Note that the amount has to be in string format.  If it is not a string, it has to be converted to a string, e.g. string($CALCULATED_SALARY).  If you use XML element name directly (like in this case SALARY), then it is already a string, so no need to do conversion.

I know this raises the question of why do we need the xdofx: prefix at all? Im discussing that with Hok Min as I write and will get back to you.


Friday Sep 09, 2011

Wacky Week

Happy Friday! Its been a week of recovery after the exertions last week at the triathlon. After swimming 1/2 a mile and then riding 17 miles, halfway through the run I thought, why am I doing this? When I reached the finish, I realised why, to get a medal of course :0) The feeling of pride and the camaraderie of other competitors was great. Going back up the trail after I had finished to cheers others on and legitimately shout at my wife was great too :0) A good afternoon, but as I say, a bit sore come Monday morning. Got out on my bike this morning for the first time after a too busy work week for a nice 25 miles and it felt great ... Im not looking forward to the winter :0(

Yeah, we look a little red and tired and my eye is doing some droopy thang but we got medals! Quick write up here, if you're interested.

This week a I got a mail from down under, specifically from Peter Laning who works for Theiss out of Brisbane Australia. Peter has been working with the JD Edwards E1 product for about 18 months and BIP for about a year now with several reports in production and more in the pipe. OK, enough about Peter already, its what Peter attached to his mail that caused me to ask him if I could share with the BIP world thats really interesting. It was a spreadsheet full of all of the BIP functions he knew about. Rather flatteringly, he asked if I could peruse the list and add any I thought he had missed. I could not spot any immediately; its an awesome list and a great crib sheet for reference. Its applicable for all but the oldest installs and is based around the 10.1.3.4.x code line.

I have put the sheets up on GoogleDocs and made it public here. So 1. If you have functions to add, please do; 2. please feel free to copy/download it and use it and finally, 3. thank Peter for putting it together.

Have a good weekend, I'll be out early on Saturday doing the Wacky W bike ride, 55 miles with too many hills and not enough air in the dizzying heights of Douglas County, CO. I will of course, be sleeping most of Sunday :0)

About

Follow bipublisher on Twitter Find Us on Facebook BI Publisher Youtube ChannelDiscussion Forum

Join our BI Publisher community to get the most and keep updated with the latest news, How-to, Solutions! Share your feedback and let us hear your voice @bipublisher on Twitter, on our official Facebook page, and Youtube!

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today