Please click here for reference on Formatter DSC.
Using the Avoka Formatter DSC
Scenario
We have extracted some dates and dollar amounts from a database and want to present them in a PDF form. In the form they need to appear human readable.
For example: Thursday, 11 February 1971,
and $12,500.61
However, in the database this data is stored something like this: Date[1971/2/11] and Float[12500.61].
Consequently, we need to format this data, within the process, before we "pump" it into the form. Obviously some hand written scripts could do this however using a purpose built component such as the Avoka Formatter makes this task much simpler and far more visible.
The Formatter DSC
|

|
The Format Date DSC is able to receive a binary date and transform into any textual string, according to the requirements.
The Format Number DSC is able to receive a binary number as input, and transform it any textual string, including the rendering of it as an amount of money. |
|
To obtain an evaluation copy of the Formatter DSC, go to the Avoka Website: http://www.avoka.com and follow the links.
The Formatter DSC, once installed, will appear as a new service in your LiveCycle WorkBench. |

|
The Process
As shown in this Figure, the task "extract data" extracts the database fields. Next we format the date and number using the respective DSCs. After the formatting steps have occurred we can pump the formatted data into the form.
Setting Properties on the Date Formatter Step
|

|
To configure the Date formatter properties we first click on the Date Formatter step and view the properties tab.
We link the DSC input to the date (produced by the SQL) step by binding to the "customerDOB" variable.
To create the desired format we enter the literal value "EEEE" (name of day), "dd" (day of month), "MMMM" (name of month), and "yyyy" (year). There is a drop-down list of date format options to choose from. As you change the format string a formatted sample of today's date appears below the drop-down.
The format string drop-down also allows custom text entry, and an info button provides a popup dialog with a date format legend. |
Setting Properties on the Number Formatter Step
|

|
To configure the Number formatter properties we first click on the Number Formatter step and view the properties tab.
We link the DSC input to the float (produced by the SQL step) by binding to the "loanAmount" variable.
To create the desired format we select a currency from the drop-down, and select the format pattern "##,###.00".
The "#" char is a non-greedy placeholder for any number, meaning that it will not insert leading 0s into the number if it is small. The "0" char in the format pattern will insert 0s into the number in the absence of a value.
The format pattern drop-down also allows custom text entry, and an info button provides a popup dialog with a number format legend. |