Showing posts with label eText. Show all posts
Showing posts with label eText. Show all posts

Tuesday, 8 July 2008

BIP XSL-TEXT Templates : Part 2

Not much changes in Birmingham.

It seems like an eternity ago that I was at university there - but after only a couple of hours and a fine Balti in a BYOB restaurant, I felt like I'd never left.

Anyway, enough of my weekend! Let's get back to XSL-TEXT templates.

Excluding XSL-FO, there are 3 different types of XSLT script templates available in BI Publisher. These are currently not greatly documented in the BIP User Guide. However, the difference between them is the format of the output created by the XSLT script i.e.:

XSL-HTMLA XSLT script to transform an XML document into a HTML file
XSL-XMLA XSLT script to transform an XML document into another XML document
XSL-TEXTA XSLT script to transform an XML document into a TEXT file


Note: The XSL element used to set the output type is:



Generally, it is a lot simpler to use an RTF or eText template to create the report layout - and I would ALWAYS recommend using an RTF or eText template where possible for this reason.

However, there comes a time when it may be easier to write XSL and XPATH directly rather than live with any shortcomings of the RTF or eText template type.

One such example of this is to add blank lines and additional formatting logic into eText templates.

In a previous blog on R12 Payments and eText templates, I built the following text file using an eText template:



Here is a XSL-TEXT template to build the same text file using the same R12 Payments XML data source:



A simple XSLT example... however, the point is that I can reference any XSL element, XPATH or extended SQL function directly. I have complete control over the layout of the text file being created.

Here are the source files:

Sample XML Data File
XSL-TEXT template

I built and tested this example using the BIP Enterprise Server (but this works equally well from Oracle E-Business Suite.)

To test this example using the BIP Server:

1) Create a new report and register the XML file as a data source:



2) Upload the XSL-TEXT layout template:



3) View the final transformed output:

Friday, 4 July 2008

BIP XSL-TEXT Templates : Part 1

Just a quick one from me today as I am of to sunny Birmingham for the weekend.

I've blogged a lot recently about ETEXT Templates and how they are used in BI Publisher to generate text files for EDI and EFT:

ETEXT Part 1


ETEXT templates are a great way of creating simple fixed or delimited text files and the Oracle Payments team have delivered loads of predefined ETEXT templates for Payments processing.

However, they are not the only way to generate text files from BI Publisher!

It is also worth considering XSL-TEXT templates.

I've found that XSL-TEXT templates are really just XSLT scripts that transform the XML into text output only.

Note:
xsl:text is actually an element or command of XSLT to write literal text strings, entity references and #PCDATA to the output file.

If you are scratching your head over what XSLT is... then, a great reference to get you up and running quickly is the W3schools tutorial.

In my next post, I'll walk through some examples of XSL-TEXT templates - but first, I have to go and join the queues of traffic trying to leave London. No fun at 5pm on a Friday night!

Monday, 23 June 2008

Padding eText files with blank lines

MikeM asked:
"How to pad an eText template with blank lines so the text file entries end up on the correct position on the stationary?
e.g. There are 25 lines available on the stationary for invoices but only 5 invoices to be paid on this payment - what steps should be taken to insert 20 blank lines after the 5 invoice lines?"



The solution that I use is to add an additional dummy Extend tag for each required blank line to the Payments Disbursement file. These are created under the 'OutboundPayment' parent.

You can add new tags to the Payments file by calling PL/SQL package 'IBY_FD_EXTRACT_EXT_PUB'. See previous blog post: http://kwoodrow.blogspot.com/2008/06/part-1-adding-new-fields-to-r12.html


After adding the new tags, the resulting XML file should look something like:
(Note - in this case, there are 3 blank lines added to the file)

XML_File


Then, in the eText template, under the 'OutboundPayment' level, create a new record to add these blank lines to the file:
(Note - this is highlighted in yellow)

Template


Finally, test the template using the BIP Template Viewer:

Template


Anyone got a different solution?

Previewing and testing eText templates

Just a quick post today.

I've had a few emails asking how we test eText templates.

Rather than using the Word Plug in to preview the result, you test eText templates using the 'Template Viewer' included with the BIP desktop toolkit.

From the Windows Start menu, click on : All Programs, Oracle BI Publisher Desktop, Template Viewer:

Menu

Once the Template Viewer is open:
- select your working directory i.e. the folder containing your eText template and preview XML data
- change the output format to eText :

Template_Viewer

and then click on the button 'Start Processing' to view the generated text file with Unix / Linux line endings:

Result