Loops in BI Publisher: for-each vs for-each-group vs for-each: current-group. ES un ejemplo de una tabla de BI publisher, para hacer un loop, con for-each y for-each-group, se parte de un xml.
xml grouping
SUPPLIERS
INVOICES
Required:
SUPPLIERS
CURRENCY
INVOICES
NOTA: VER IMAGENES Y IMAGEN DE LOS CAMPOS DEL XML.
‘for-each-group’ to regroup to show the invoices by currenc, [<?for-each-group:G_INVOICE_NUM;INVOICE_CURRENCY_CODE?>]
This is specifying that we want to create a new group ‘INVOICE_CURRENCY_CODE’ based on the original ‘G_INVOICE_NUM’ group.
We now have ‘for-each:current-group()’ to refer to the new INVOICE_CURRENCY_CODE group we have just created.
Note: we cannot refer to the group as INVOICE_CURRENCY_CODE as this group is only created at runtime.
sum (current-group()/ENT_AMT) for the entered amount, again we use the current-group() tag to refer to the new ‘INVOICE_CURRENCY_CODE’ group.
<?for-each:G_VENDOR_NAME?>
<?for-each-group:G_INVOICE_NUM;INVOICE_CURRENCY_CODE?>
Colocar imagen: tabla con campos BIpublisher.jpg esta en descaragas
pego a que el código :
<?for-each:G_VENDOR_NAME?>
<?for-each-group:G_INVOICE_NUM;INVOICE_CURRENCY_CODE?>
Currency: USD
<?for-each:current-group()?>
<?INVOICE_NUM?>
<?INV_TYPE?>
<?INVOICE_DATE?>
<?GL_DATE?>
<?ENT_AMT?>
<?ACCTD_AMT?>
<?end for-each?>
Total for <?INVOICE_CURRENCY_CODE?>
<? sum(current-group()/ENT_AMT)?>
<?format-number(sum(current-group()/ACCTD_AMT),"#,###.00","Euro")?>
<?end for-each-group?>
Nota: ver la salida en el articulo original.
Fuentes
Artículo: "Understand Loops in BI Publisher: for-each vs for-each-group vs for-each: current-group" Publicado en https://appsoracle-abhi.blogspot.com/ por Abhishek el 29 oct 2018. consultado el 24 ago 2025.
URl: https://appsoracle-abhi.blogspot.com/2018/10/understand-loops-in-bi-publisher-for.html