Quick XML Publisher Tips

Oracle Business Intelligence, Oracle Warehouse Builder OWB, Oracle Discoverer, BI Publisher, XML Publisher, OLAP, Data Mining, ODI Oracle Data Integrator, etc
Post Reply
User avatar
dr_gori
Moderador
Moderador
Posts: 5024
Joined: Mon, 03 May 2004 3:08 pm
Location: Portland, OR USA
Contact:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

A simple IF Endif \r\n

Select all

<?if:OU_REGION2='SP'?> SE REGIÃO FOR SP VAI MOSTRAR ESSE TEXTO, CAMPOS, ETC <?end if?>
Test if a field is null \r\n

Select all

<?if: ITEM_ANTIGO != ''?> SE TEM ITEM ANTIGO ISSO VAI APARECER <?end if?>
Do NVL Inside XML Publisher \r\n
After several attempts, this is the way it was more efficient:

Select all

<?choose:?> 
  <?when:PROMISED_DATE!=''?> AQUI VAI TEXTO E CAMPOS <?end when?> 
  <?otherwise:?> SE O PROMISED_DATE FOR NULO, VAI  VAI MOSTRAR ISSO <?end otherwise?> 
<?end choose?>
IF ELSE with substr \r\n

Select all

<?xdoxslt:ifelse(substring(ITEM,1,4)='JOAO', 'JOAO DA SILVA', 'não é o joao')?>
Page Break Conditional \r\n

Select all

<?if:CF_LPN_FLAG='Y'?> 
 <?split-by-page-break: ?> 
<?end if?> 
]
or

Select all

<?for-each:DEPT?> 
... 
... 
... 
<?split-by-page-break:?> 
<?end for-each?>

Convert Data DD-Mon-YYYY to DD / mm / yyyy \r\n
cases that can not change the query (mainly in core reports, where the date definition is not an xml, but some routine in java. Then it is possible to format the date using decode (this case does not matter if it is English or portuguese) [


TAG To boot Header and Footer Complex \r\n
The standard Header problem of RTF / Word is that they do not accept use "Fields". In summary, the code occupies a lot of physical space. Dai can happen that the header stays half of the page! (and this size is fixed ). To solve the problem, the standard Word Header is not used. We put the header on the page itself and informs Bi Publisher where the header is, the body and footer for these special tags:

Select all

SEU_CABEÇALHO COMPLEXO AQUI 
SEU_CABEÇALHO COMPLEXO AQUI 
<?start:body?> 
CORPO DO RELATÓRIO 
CORPO DO RELATÓRIO 
<?end body?> 
FOOTER DO RELATORIO
had cases that this above did not work. Then I used the following tags that worked:

Select all

<?body-start?> 
<?body-end?>
Make a sum using variables \r\n

1. Initialize the variable "var" outside the repetition group:

Select all

<?xdoxslt:set_variable($_XDOCTX,’var’,0)?>  
2. Within the group, add the value of a field (in this case, the line_amount). As the field has formatted with commas, it removes and places a point where it should:

Select all

<?xdoxslt:set_variable($_XDOCTX,’var’,xdoxslt:get_variable($_XDOCTX,’var’)+ translate(translate(LINE_AMOUNT,'.',''),',','.'))?>
3. At the end of the report, it shows the formatted var value:

Select all

<? format-number: xdoxslt:get_variable($_XDOCTX,’var’); '999G999G999D99' ?>
Tip: You can boot the variable with some value. This is useful for making sums per page, for example ... or in my case, use a previous total to make the sum of debt and daily credit.

Repeat group with sorting in 2 fields \r\n

Select all

 
<?for-each:LINE_LOCATIONS_ROW?> 
<?sort:../../LINE_NUM;'ascending';data-type='number'?> 
<?sort:PROMISED_DATE;'ascending';data-type='text'?>
This is more for fast consultation as it is possible to do this using Wizards, etc.
This example is creating a loop in line_locations_row and forcing ordering by Line_NUM in 2 previous levels and also in Promised_Date.

Export XML Publisher via FndLoad [/ Size]
Example:

Select all

 
FNDLOAD apps/senha 0 Y DOWNLOAD $XDO_TOP/patch/115/import/xdotmpl.lct ~/thomas/seu_arq.ldt XDO_DS_DEFINITIONS APPLICATION_SHORT_NAME=XG DATA_SOURCE_CODE=XG_XML_AP_001
The next Low example A single datadefinition (arxCOBLX) and a specific template:

Select all

FNDLOAD user/pword@mydb 0 Y DOWNLOAD 
$XDO_TOP/patch/115/import/xdotmpl.lct XMLPData.ldt XDO_DS_DEFINITIONS 
APPLICATION_SHORT_NAME=AR DATA_SOURCE_CODE=ARXCOBLX 
TMPL_APP_SHORT_NAME=AR 
TEMPLATE_CODE=ARLETTER1
interim colors of each line (Zebra type) \r\n
It is possible to make the report come out each line with a color, example: white, gray, white, gray, etc.

Select all

 
<?choose:?> 
 <?when:position() mod 2=0?> 
 <?attribute@incontext:background-color;'Yellow'?> 
 <?end when?> 
 <?otherwise:?> 
 <?attribute@incontext:background-color;'Red'?> 
 <?end otherwise?> 
<?end choose?> 
In this [url=http://garethroberts.blogspot.com/2007/ ... -cell.html]LINK has a listing of colors and other coloring forms.

Keep zeros on the left When the output is Excel
Excel is so smart that when he sees an 00001, he places 1. The Problem is that sometimes we want the zeros in front. To do this, just use the code below: (and replace item_number by your field with zeros)

Select all

<fo:bidi-override direction="ltr" unicode-bidi="bidi-override"> 
<?ITEM_NUMBER?> 
</fo:bidi-override> 
Another way is to put like this:

Select all

="<seu_campo_aqui>"
puts a = "and closes quotes at the end. Dai Excel leaves the zeros! I had to use that way because the way the user can not do PROC-V.


Format Values ??- Money [/ Size]
This command formats the output of cash, according to the currency. [[19]

Select all

<?format-currency:CAMPO_VALOR;CAMPO_CURRENCY_CODE;'false'?>
Find more error details in the opp log. [/ Size]
Sometimes XML Publisher only gives a message:
Post-Processing of Request 39113073 Failed at 14-Mar- 2014 19:19:13 With the error message:
One or more Post-Processing Actions Failed. Consult The OPP Service Log for Details.

In these cases, we run the following Query to find the file containing more details:

Select all

SELECT fcpp.concurrent_request_id req_id, fcp.node_name, fcp.logfile_name 
  FROM fnd_conc_pp_actions fcpp, fnd_concurrent_processes fcp 
 WHERE fcpp.processor_id = fcp.concurrent_process_id 
   AND fcpp.action_type = 6 
   AND fcpp.concurrent_request_id = 39113073   -- this is the request id
View Note 364547.1 Metalink.
Attachments
2023-12-12_14-57.png
2023-12-12_14-56.png
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests