Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to print login user name in PDF by using apache FOp.jar

k.RamuJun 19 2018 — edited Jun 19 2018

Hi Friends,

I'm exporting VO's data as pdf by using apache FOP.jar, but how can I print Login user name in PDF.

For printing in PDF used one template.xsl file.

FYI pasting the template.xsl file code

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

<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

                xmlns:fo="http://www.w3.org/1999/XSL/Format">

    <xsl:output encoding="iso-8859-1"/>

    <xsl:template match="SupplySanpshot">

  

    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

            <fo:layout-master-set>

                <fo:simple-page-master master-name="SupplySanpshotRow" page-height="11.7in" page-width="11.7in"

                                       margin-top=".5in" margin-bottom=".5in" margin-left=".25in" margin-right=".25in">

                    <fo:region-body margin-top="1in" margin-bottom="1in"/>

<fo:region-before extent=".5in"/>

<fo:region-after extent=".5in"/>

                </fo:simple-page-master>

            </fo:layout-master-set>

            <fo:page-sequence master-reference="SupplySanpshotRow">

                <fo:flow flow-name="xsl-region-body">

                    <fo:block>

                        <fo:table width="100%" border="solid 0.1mm black">

                          

                            <fo:table-header>

                                <fo:table-row>

                                    <fo:table-cell border="solid 1px black" padding="5px">

                                        <fo:block>S.No</fo:block>

                                    </fo:table-cell>

                                    <fo:table-cell border="solid 1px black" padding="5px">

                                        <fo:block>Invoice Number</fo:block>

                                    </fo:table-cell>

                                    <fo:table-cell border="solid 1px black" padding="5px">

                                        <fo:block>Invoice Date</fo:block>

                                    </fo:table-cell>

                                    <fo:table-cell border="solid 1px black" padding="5px">

                                        <fo:block>Invoice Quantity</fo:block>

                                    </fo:table-cell>

                                    <fo:table-cell border="solid 1px black" padding="5px">

                                        <fo:block>Shortage Quantity</fo:block>

                                    </fo:table-cell>

                                    <fo:table-cell border="solid 1px black" padding="5px">

                                        <fo:block>Documented Shortage Quantity</fo:block>

                                    </fo:table-cell>

                                   

                                   

                                </fo:table-row>

                            </fo:table-header>

                            <fo:table-body>

                                <xsl:for-each select="./SupplySanpshotRow">

                              <fo:table-row>

                                        <fo:table-cell border="solid 1px black" padding="5px">

                                            <fo:block>

                                                <xsl:value-of select="SNo"/>

                                            </fo:block>

                                        </fo:table-cell>

                                        <fo:table-cell border="solid 1px black" padding="5px">

                                            <fo:block>

                                                <xsl:value-of select="InvoiceNumber"/>

                                            </fo:block>

                                        </fo:table-cell>

                                        <fo:table-cell border="solid 1px black" padding="5px">

                                            <fo:block>

                                                <xsl:value-of select="InvoiceDate"/>

                                            </fo:block>

                                        </fo:table-cell>

                                        <fo:table-cell border="solid 1px black" padding="5px">

                                            <fo:block>

                                                <xsl:value-of select="InvoiceQuantity"/>

                                            </fo:block>

                                        </fo:table-cell>

                                        <fo:table-cell border="solid 1px black" padding="5px">

                                            <fo:block>

                                                <xsl:value-of select="shrtQuantity"/>

                                            </fo:block>

                                        </fo:table-cell>

                                        <fo:table-cell border="solid 1px black" padding="5px">

                                            <fo:block>

                                                <xsl:value-of select="DocumentShortQuantity"/>

                                            </fo:block>

                                        </fo:table-cell>

                                       

                                       

                                    </fo:table-row>

                                    </xsl:for-each>

                            </fo:table-body>

                        </fo:table>

                   

                    </fo:block>

                </fo:flow>

            </fo:page-sequence>

        </fo:root><xsl:text>Pdf download listner</xsl:text>

</xsl:template>

</xsl:stylesheet>

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 17 2018
Added on Jun 19 2018
2 comments
141 views