Thanks to Martin Honnen, and mhkay,
I tried to do as you people told but licencing comes as a disadvantage .
Then I tried with only XSLT1.0
I donât know JAXP or other we are using for the FOP.
But now its working some how, but I am not able to subgroup it. I tried but did not get success.
I did as following:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright (c) 2010. PharmApps, LLC ~
~ This software is the confidential and proprietary information of PharmApps, LLC.
~ ("Confidential Information"). ~
~
~ File Name : noncurrentterms_eng.xsl ~
~ Created By: Narendra Mohan "Employed by Aris global Software Pvt Ltd." ~
~ Date: 06 Sep 2010 ~
~ Description : Audit trail report generation xsl ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!-- $Id$ -->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">
<xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes"/>
<xsl:param name="auditTitle" select="'agEncoder Audit Trail Report'"/>
<xsl:param name="fieldName" select="'Field Name'"/>
<xsl:param name="functionType" select="'Function Type'"/>
<xsl:param name="operationType" select="'Operation Type'"/>
<xsl:param name="oldVal" select="'Old Value'"/>
<xsl:param name="newVal" select="'New Value'"/>
<xsl:param name="entityName" select="'Entity Name'"/>
<xsl:param name="transactionId" select="'Transaction ID'"/>
<xsl:param name="modifiedBy" select="'Modified By'"/>
<xsl:param name="modifiedDate" select="'Modified Date'"/>
<xsl:param name="moduleName" select="'Module Name'"/>
<xsl:param name="sessionInfoLabel" select="'Session Information'"/>
<xsl:param name="userID" select="'user ID'"/>
<xsl:param name="useFont" select="'Courier, monospace'"/>
<xsl:param name="opDate" select="'Date of Operation'"/>
<xsl:param name="sessID" select="'Session ID'"/>
<xsl:param name="fontSize" select="8"/>
<!-- ========================= -->
<!-- root element: projectteam -->
<!-- ========================= -->
<xsl:key name="rowset-by-row" match="ROW" use="COL9" />
<xsl:template match="ROWSET">
<xsl:param name="totalno" select="''"/>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master page-height="28cm" page-width="21cm"
margin-top="1cm" margin-bottom="1cm" margin-left="1.5cm" margin-right="1cm"
master-name="simpleA4">
<fo:region-body region-name="frame-body" margin="1cm"/>
<fo:region-before extent="0.75cm" region-name="frame-before"/>
<fo:region-after extent="0.75cm" region-name="frame-after"/>
<fo:region-start extent="0.75cm"/>
<fo:region-end extent="0.75cm"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="cover"
page-height="28cm"
page-width="21cm"
margin-top="0.5cm"
margin-bottom="0.5cm"
margin-left="1cm"
margin-right="0.5cm">
<fo:region-body region-name="frame-body"
margin-top="12cm" />
</fo:simple-page-master>
<fo:page-sequence-master master-name="reportpage" >
<fo:repeatable-page-master-alternatives >
<fo:conditional-page-master-reference master-reference="simpleA4"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="cover">
<fo:flow flow-name="frame-body">
<fo:block font-family="Helvetica" font-size="18pt"
text-align="center">
<xsl:value-of select="$auditTitle"/>
</fo:block>
<fo:block font-family="Helvetica" font-size="12pt"
text-align="center" space-after="36pt">
<xsl:value-of select="$auditTitle"/>
</fo:block>
<fo:block text-align="end">
A Catcode Production
</fo:block>
</fo:flow>
</fo:page-sequence>
<fo:page-sequence master-reference="reportpage" >
<fo:static-content flow-name="frame-before" >
<fo:block font-size="10pt" font-weight="normal" border-end-width="1pt" border-color="black" font-family="{$useFont}" text-align="center">
<fo:leader rule-thickness="0pt" /> <xsl:value-of select="$auditTitle"/>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="frame-after" >
<fo:block font-size="10pt" text-align="center" border-top-width="1pt" border-top-color="black" font-weight="normal" font-family="{$useFont}">
<fo:leader rule-thickness="0pt" /> <fo:page-number initial-page-number="0"/>
</fo:block>
</fo:static-content>
<fo:flow flow-name="frame-body" >
<xsl:for-each select="ROW[count(. | key('rowset-by-row',COL9)[1]) = 1]">
<xsl:sort select="COL9" />
<xsl:key name="row-by-opType" match="rowset-by-row" use="COL1" />
<fo:block font-size="9pt" font-family="{$useFont}" font-weight="bold">
<xsl:value-of select="$sessionInfoLabel"/>
</fo:block>
<fo:block font-size="9pt" font-family="{$useFont}">
 
<xsl:value-of select="$sessID"/>:  <xsl:value-of select="COL9" />
     
<xsl:value-of select="$userID"/>:  <xsl:value-of select="COL7" />
     
<xsl:value-of select="$opDate"/>:  <xsl:value-of select="COL8" />
</fo:block>
<fo:block font-size="8pt">
 <xsl:value-of select="$moduleName"/>: <xsl:value-of select="COL12" />
     
<xsl:value-of select="$operationType"/>:  <xsl:value-of select="COL1" />
</fo:block>
<fo:block>
 
</fo:block>
<fo:block font-size="10pt" space-after="5mm">
<fo:table table-layout="fixed" width="100%" border-collapse="separate">
<fo:table-column column-width="4cm"/>
<fo:table-column column-width="6cm"/>
<fo:table-column column-width="6cm"/>
<fo:table-header>
<fo:table-row display-align="center">
<fo:table-cell number-columns-spanned="1" margin-right="1pt" border-width="0.500pt" border-style="solid" border-color="rgb(0,0,0)" margin-left="1pt" margin-bottom="1pt" margin-top="1pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always" height="15pt">
<fo:block font-family="{$useFont}" font-weight="bold" font-style="bold" text-align="center" font-size="{$fontSize}">
<xsl:value-of select="$fieldName"/>
</fo:block>
</fo:table-cell>
<fo:table-cell number-columns-spanned="1" margin-right="1pt" border-width="0.500pt" border-style="solid" border-color="rgb(0,0,0)" margin-left="1pt" margin-bottom="1pt" margin-top="1pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always" height="15pt">
<fo:block font-family="{$useFont}" font-weight="bold" text-align="center" font-size="{$fontSize}">
<xsl:value-of select="$oldVal"/>
</fo:block>
</fo:table-cell>
<fo:table-cell number-columns-spanned="1" margin-right="1pt" border-width="0.500pt" border-style="solid" border-color="rgb(0,0,0)" margin-left="1pt" margin-bottom="1pt" margin-top="1pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always" height="15pt">
<fo:block font-family="{$useFont}" font-weight="bold" text-align="center" font-size="{$fontSize}">
<xsl:value-of select="$newVal"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<xsl:for-each select="key('rowset-by-row', COL9)"> <!-- select="ROW">-->
<fo:table-row display-align="auto">
<fo:table-cell number-columns-spanned="1" margin-right="1pt" margin-left="1pt" border-width="0.500pt" border-style="solid" border-color="rgb(0,0,0)" margin-bottom="1pt" margin-top="1pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always" height="15pt">
<fo:block font-family="{$useFont}" font-weight="normal" font-size="{$fontSize}">
<xsl:value-of select="COL2" />
</fo:block>
</fo:table-cell>
<fo:table-cell number-columns-spanned="1" margin-right="1pt" margin-left="1pt" margin-bottom="1pt" border-width="0.500pt" border-style="solid" border-color="rgb(0,0,0)" margin-top="1pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always" height="15pt">
<fo:block font-family="{$useFont}" font-weight="normal" font-size="{$fontSize}">
<xsl:value-of select="COL4"/>
</fo:block>
</fo:table-cell>
<fo:table-cell number-columns-spanned="1" margin-right="1pt" margin-left="1pt" margin-bottom="1pt" border-width="0.500pt" border-style="solid" border-color="rgb(0,0,0)" margin-top="1pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always" height="15pt">
<fo:block font-family="{$useFont}" font-weight="normal" font-size="{$fontSize}">
<xsl:value-of select="COL5"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</fo:block>
</xsl:for-each>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>