Thursday, May 20, 2021

OIC - ERP - xsl template to create control file BI report

Usecase: This xsl template is used to create a text file, comma separated csv file where we can use some xslt aggregator functions.

.xsl template:

<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="2.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:exslt="http://exslt.org/common"

xmlns:xdoxslt="http://www.oracle.com/XSL/Transform/java/oracle.xdo.template.rtf.XSLTFunctions"

xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>

<xsl:template match="/">

<xsl:text>REPORT_NAME</xsl:text>

<xsl:text>,</xsl:text>

<xsl:text>ROW_COUNT</xsl:text>

<xsl:text>,</xsl:text>

<xsl:text>TOTAL_AMOUNT</xsl:text>

<xsl:text>&#xa;</xsl:text>

<xsl:text>AP: BI_REPORT_NAME</xsl:text>

<xsl:text>,</xsl:text>

<xsl:value-of select="count(DATA_DS/G_1)"/>

<xsl:text>,</xsl:text>

<xsl:value-of select="sum(DATA_DS/G_1/PAID_AMOUNT)"/>

</xsl:template>

</xsl:stylesheet>


We can also use some format number functions as below:

format-number(count(DATA_DS/G_1)-1,'#')

format-number(count(DATA_DS/G_1[SUMD!=0),'#')

format-number(sum(DATA_DS/G_1/SUMD),'#.00')


No comments:

Post a Comment

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...