Showing posts with label XML. Show all posts
Showing posts with label XML. Show all posts

Wednesday, December 17, 2014

Amount in Words using XML/BI Publisher Tags

I once had a requirement to display the amount(number) to words(letters). And below is the approach i have followed.

We can convert the Amount into Words in two different ways:

1)Using the XML/BI Publisher Tag (Applicable only to R12).
2)Using the function IBY_AMOUNT_IN_WORDS.Get_Amount_In_Words(TOTAL_AMOUNTS1)

1) Using XML/BI Publisher Tag:

a)  

--> CASE_INIT_CAP, CASE_UPPER, and CASE_LOWER are available to display the text  in Initial Caps,Upper Case,Lower Case respectively.
--> DECIMAL_STYLE_FRACTION1(default), DECIMAL_STYLE_FRACTION2, and DECIMAL_STYLE_WORDS are available.
--> USD in the above tag can be replaced by the curreny code required as per the requirement.

b)  
[ Sorry, there was a problem writing the tag in my browser,so i have taken a snapshot of it and pasted here. ]

2)  Using IBY_AMOUNT_IN_WORDS.Get_Amount_In_Words(TOTAL_AMOUNTS1)

 Example :
declare
v1 VARCHAr2(2000);
begin
v1:=IBY_AMOUNT_IN_WORDS.Get_Amount_In_Words(p_amount =>101324546014);
dbms_output.put_line('amount: '||v1);
end; 

If you expect the Amount in Words to show as shown below

--> One Thousand Pounds and 14 Pence.
 --> One Hundred Euros and 1 Cent.
--> 1 Dollar and 99 Cents.
  
Refer the Oracle Document for setting the currency unit and sub_unit in the system. Click ME.

Challa. 

Thursday, November 27, 2014

To Get the XML file or Request Output file for XML Reports Concurrent Requests.

Get the XML File from a BI Publisher based concurrent request/report:



Get the XML File from a BI Publisher based concurrent request/report:

1.View->Requests
2.Find the request you're interested in
3.Click on Diagnostics button
4.Click the View XML
5.Save the file to your PC by doing File->Save As, *.xml

But where does the XML file get stored.?

Well, by default it is $APPLCSF/$APPLOUT/o{REQUEST_ID}.out.

But if that's the XML file, then where does the actual output file reside as the location of the XML file is where normal request output resides?
Get the Request Output File for a BI Publisher based concurrent request/report:

The output is $APPLCSF/$APPLOUT/{REPORTNAME}_{REQUEST_ID}_{COUNT}.PDF|RTF|EXCEL|HTML

Where

>  REPORTNAME is the concurrent program short name,
>  REQUEST_ID is the concurrent request ID
>  COUNT is a counter based on the number of times a request has been re-published.
>  One of PDF, RTF, EXCEL, HTML is the file extension/type dependent on the output formats chosen.

An example is: XXXX_FNDSCURS_2803880_1.EXCEL

Output file location courtesy of Tim's post here.

Cool, file locations identified..!!


Challa.

Tuesday, November 11, 2014

BI Publisher Template Viewer

BI Publisher Template Viewer

In the times of BIP 11g, online layout editing and frolicking free data modeling, a wee little tool is almost forgotten: The BI Publisher Template Viewer. Never heard of it? Well, read on then...

The template viewer is a handy little tool installed along the BI Publisher Desktop (aka Word Add-In or Template Builder). It's main purpose is to assist in debugging non-RTF templates such as eText or Excel templates but it can be used for any other template type (excluding the new .xpt templates built using the 11g online editor).

If you launch it from the respective Start menu item on your Windows workstation, it presents itself as a simple Java application.



The usage is plain simple, for example:

1. To debug a template you use the Browse... button to specify a working directory. The directory must contain at least one sample XML file and at least one template file. You could give it a first try with the sample folders delivered with the BI Publisher Desktop.

2. In the Data window, select the sample XML file to use.

3. In the Template window, select the template to use.

4. Specify an output format and locale and click the Start Processing button.

Depending on the log level (see below), verbose output is generated and finally the document viewer (such as Adobe Acrobat Reader) is launched to display the generated output document. Of course, errors are displayed in the output window if the template is buggy.

The debug level and report parameters can be set in the Setting (Default) tab:


In the above example, the log level is set to STATEMENT (Maximum Log).




Challa.