当前位置: 首页 > 知识库问答 >
问题:

FOP–内存不足多页序列错误

高祺
2023-03-14

我使用ApacheFOP2.2生成PDF报告。每当有超过20K条记录时,我就会收到“内存不足错误:Java堆空间”错误。我尝试增加页面序列的数量,这提高了性能,但当将超过20K条记录的XML转换为PDF时,仍然会出现内存不足的错误。在没有多页序列的情况下,仅成功转换了2K条记录。下面是使用的XML结构和XSL模板。

要求是生成至少75K记录的PDF(取决于数据库数据)。请建议如何修改XSL-FO模板或XML格式来解决这个问题。

<Report>
    <Header></Header>
    <Records>
        <IncompletedRecords>
            <IncompleteRec>
                <FName></FName>
                <LName></LName>
                <Address></Address>
                <LastUpdDate></LastUpdDate>
            </IncompleteRec>
            <IncompleteRec>
                <FName></FName>
                <LName></LName>
                <Address></Address>
                <LastUpdDate></LastUpdDate>
            </IncompleteRec>
            .
            .
            .
            <IncompleteRec>...</IncompleteRec>
            <IncompleteRec>...</IncompleteRec>
        </IncompletedRecords>
        <ApprovedRecords>
            <ApprovedRec>
                <FName></FName>
                <LName></LName>
                <Address></Address>
                <LastUpdDate></LastUpdDate>
            </ApprovedRec>
            <ApprovedRec>
                .
            </ApprovedRec>
            .
            .
            .
            <ApprovedRec>...</ApprovedRec>
            <ApprovedRec>...</ApprovedRec>
        </ApprovedRecords>
        <DeletedRecords>
            <DeletedRec>
                <FName></FName>
                <LName></LName>
                <Address></Address>
                <LastUpdDate></LastUpdDate>
            </DeletedRec>
            <DeletedRec>
                .
                .
            </DeletedRec>
            .
            .
            .
            <DeletedRec>...</DeletedRec>
            <DeletedRec>...</DeletedRec>
        </DeletedRecords>
        <PendingRecords>
            <PendingRec>
                <FName></FName>
                <LName></LName>
                <Address></Address>
                <LastUpdDate></LastUpdDate>
            </PendingRec>
            <PendingRec>
                .
                .
            </PendingRec>
            .
            .
            .
            <PendingRec>...</PendingRec>
            <PendingRec>...</PendingRec>
        </PendingRecords>
        <DeactivatedRecords>
            <DeactivatedRec>
                <FName></FName>
                <LName></LName>
                <Address></Address>
                <LastUpdDate></LastUpdDate>
            </DeactivatedRec>
            <DeactivatedRec>
                .
                .
            </DeactivatedRec>
            .
            .
            .
            <DeactivatedRec>...</DeactivatedRec>
            <DeactivatedRec>...</DeactivatedRec>
        </DeactivatedRecords>
        <RejectedRecords>
            <RejectedRec>
                <FName></FName>
                <LName></LName>
                <Address></Address>
                <LastUpdDate></LastUpdDate>
            </RejectedRec>
            <RejectedRec>
                .
            </RejectedRec>
            .
            .
            .
            <RejectedRec>...</RejectedRec>
            <RejectedRec>...</RejectedRec>
        </RejectedRecords>
    </Records>
</Report>
    <xsl:template match="Report">
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
        <fo:layout-master-set>
            <fo:simple-page-master master-name="page"
                page-height="11in" page-width="8.5in" margin-left="0.45in"
                margin-right="0.6in" margin-top="0.25in" margin-bottom="0.25in">
                <fo:region-body region-name="xsl-region-body" />
                <fo:region-before region-name="xsl-region-before" />
                <fo:region-after region-name="xsl-region-after" />
            </fo:simple-page-master>
        </fo:layout-master-set>

        <!-- 1st page sequence -->
        <fo:page-sequence master-reference="page"
            initial-page-number="1" id="myseq">
            <fo:static-content flow-name="xsl-region-after">
                <fo:block text-align="end" font-size="10pt" font-family="serif"
                    line-height="14pt">
                    Page
                    <fo:page-number />
                    of
                    <fo:page-number-citation-last ref-id="myseq" />
                </fo:block>
            </fo:static-content>
            <fo:flow flow-name="xsl-region-body">
                <xsl:apply-templates select="Header" />
                <fo:block>
                    <fo:block font-size="8pt">
                        <fo:table table-layout="fixed" width="100%"
                            border-collapse="collapse">
                            <fo:table-column column-width="1.5in" />
                            <fo:table-column column-width="2.5in" />
                            <fo:table-column column-width="1.5in" />
                            <fo:table-column column-width="2in" />
                            <fo:table-header border-bottom="1pt solid black">
                                <fo:table-cell padding-left="3pt"
                                    background-color="lightgrey" height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">First Name</fo:block>
                                </fo:table-cell>
                                <fo:table-cell background-color="lightgrey"
                                    height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">Last Name</fo:block>
                                </fo:table-cell>
                                <fo:table-cell background-color="lightgrey"
                                    height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">Address</fo:block>
                                </fo:table-cell>
                                <fo:table-cell background-color="lightgrey"
                                    height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">Last Changed By</fo:block>
                                </fo:table-cell>
                            </fo:table-header>

                            <fo:table-body>
                                <fo:table-row>
                                    <fo:table-cell>
                                        <fo:block></fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                                <xsl:call-template name="header.status">
                                    <xsl:with-param name="name" select="'Incomplete'" />
                                </xsl:call-template>
                                <!-- No records -->
                                <xsl:if
                                    test="count(Records/IncompleteRecords/IncompleteRec) = 0">
                                    <xsl:call-template name="norecords">
                                    </xsl:call-template>
                                </xsl:if>

                                <xsl:apply-templates
                                    select="Records/IncompleteRecords/IncompleteRec"></xsl:apply-templates>
                            </fo:table-body>
                        </fo:table>
                    </fo:block>
                </fo:block>
            </fo:flow>
        </fo:page-sequence>

        <!-- 2nd page sequence -->
        <fo:page-sequence master-reference="page" id="myseq">
            <fo:flow flow-name="xsl-region-body">
                <fo:block>
                    <fo:block font-size="8pt">
                        <fo:table table-layout="fixed" width="100%"
                            border-collapse="collapse">
                            <fo:table-column column-width="1.5in" />
                            <fo:table-column column-width="2.5in" />
                            <fo:table-column column-width="1.5in" />
                            <fo:table-column column-width="2in" />
                            <fo:table-header border-bottom="1pt solid black">
                                <fo:table-cell padding-left="3pt"
                                    background-color="lightgrey" height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">First Name</fo:block>
                                </fo:table-cell>
                                <fo:table-cell background-color="lightgrey"
                                    height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">Last Name</fo:block>
                                </fo:table-cell>
                                <fo:table-cell background-color="lightgrey"
                                    height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">Address</fo:block>
                                </fo:table-cell>
                                <fo:table-cell background-color="lightgrey"
                                    height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">Last Changed By</fo:block>
                                </fo:table-cell>
                            </fo:table-header>

                            <fo:table-body>
                                <fo:table-row>
                                    <fo:table-cell>
                                        <fo:block></fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                                <xsl:call-template name="header.status">
                                    <xsl:with-param name="name" select="'Approved'" />
                                </xsl:call-template>
                                <xsl:if test="count(Records/ApprovedRecords/ApprovedRec) = 0">
                                    <xsl:call-template name="norecords">
                                    </xsl:call-template>
                                </xsl:if>
                                <xsl:apply-templates
                                    select="Records/ApprovedRecords/ApprovedRec"></xsl:apply-templates>
                            </fo:table-body>
                        </fo:table>
                    </fo:block>
                </fo:block>
            </fo:flow>
        </fo:page-sequence>

        <!-- 3rd page sequence -->
        <fo:page-sequence master-reference="page" id="myseq">
            <fo:flow flow-name="xsl-region-body">
                <fo:block>
                    <fo:block font-size="8pt">
                        <fo:table table-layout="fixed" width="100%"
                            border-collapse="collapse">
                            <fo:table-column column-width="1.5in" />
                            <fo:table-column column-width="2.5in" />
                            <fo:table-column column-width="1.5in" />
                            <fo:table-column column-width="2in" />
                            <fo:table-header border-bottom="1pt solid black">
                                <fo:table-cell padding-left="3pt"
                                    background-color="lightgrey" height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">First Name</fo:block>
                                </fo:table-cell>
                                <fo:table-cell background-color="lightgrey"
                                    height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">Last Name</fo:block>
                                </fo:table-cell>
                                <fo:table-cell background-color="lightgrey"
                                    height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">Address</fo:block>
                                </fo:table-cell>
                                <fo:table-cell background-color="lightgrey"
                                    height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">Last Changed By</fo:block>
                                </fo:table-cell>
                            </fo:table-header>

                            <fo:table-body>
                                <fo:table-row>
                                    <fo:table-cell>
                                        <fo:block></fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                                <xsl:call-template name="header.status">
                                    <xsl:with-param name="name" select="'Deleted'" />
                                </xsl:call-template>
                                <xsl:if test="count(Records/DeletedRecords/DeletedRec) = 0">
                                    <xsl:call-template name="norecords">
                                    </xsl:call-template>
                                </xsl:if>
                                <xsl:apply-templates
                                    select="Records/DeletedRecords/DeletedRec"></xsl:apply-templates>
                            </fo:table-body>
                        </fo:table>
                    </fo:block>
                </fo:block>
            </fo:flow>
        </fo:page-sequence>

        <!-- 4th page sequence -->
        <fo:page-sequence master-reference="page" id="myseq">
            <fo:flow flow-name="xsl-region-body">
                <fo:block>
                    <fo:block font-size="8pt">
                        <fo:table table-layout="fixed" width="100%"
                            border-collapse="collapse">
                            <fo:table-column column-width="1.5in" />
                            <fo:table-column column-width="2.5in" />
                            <fo:table-column column-width="1.5in" />
                            <fo:table-column column-width="2in" />
                            <fo:table-header border-bottom="1pt solid black">
                                <fo:table-cell padding-left="3pt"
                                    background-color="lightgrey" height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">First Name</fo:block>
                                </fo:table-cell>
                                <fo:table-cell background-color="lightgrey"
                                    height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">Last Name</fo:block>
                                </fo:table-cell>
                                <fo:table-cell background-color="lightgrey"
                                    height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">Address</fo:block>
                                </fo:table-cell>
                                <fo:table-cell background-color="lightgrey"
                                    height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">Last Changed By</fo:block>
                                </fo:table-cell>
                            </fo:table-header>

                            <fo:table-body>
                                <fo:table-row>
                                    <fo:table-cell>
                                        <fo:block></fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                                <xsl:call-template name="header.status">
                                    <xsl:with-param name="name" select="'Deactivated'" />
                                </xsl:call-template>
                                <xsl:if test="count(Records/DeactivatedRecords/DeactivatedRec)=0">
                                    <xsl:call-template name="norecords">
                                    </xsl:call-template>
                                </xsl:if>
                                <xsl:apply-templates
                                    select="Records/DeactivatedRecords/DeactivatedRec"></xsl:apply-templates>
                            </fo:table-body>
                        </fo:table>
                    </fo:block>
                </fo:block>
            </fo:flow>
        </fo:page-sequence>

        <!-- 5th page sequence -->
        <fo:page-sequence master-reference="page" id="myseq">
            <fo:flow flow-name="xsl-region-body">
                <fo:block>
                    <fo:block font-size="8pt">
                        <fo:table table-layout="fixed" width="100%"
                            border-collapse="collapse">
                            <fo:table-column column-width="1.5in" />
                            <fo:table-column column-width="2.5in" />
                            <fo:table-column column-width="1.5in" />
                            <fo:table-column column-width="2in" />
                            <fo:table-header border-bottom="1pt solid black">
                                <fo:table-cell padding-left="3pt"
                                    background-color="lightgrey" height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">First Name</fo:block>
                                </fo:table-cell>
                                <fo:table-cell background-color="lightgrey"
                                    height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">Last Name</fo:block>
                                </fo:table-cell>
                                <fo:table-cell background-color="lightgrey"
                                    height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">Address</fo:block>
                                </fo:table-cell>
                                <fo:table-cell background-color="lightgrey"
                                    height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">Last Changed By</fo:block>
                                </fo:table-cell>
                            </fo:table-header>

                            <fo:table-body>
                                <fo:table-row>
                                    <fo:table-cell>
                                        <fo:block></fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                                <xsl:call-template name="header.status">
                                    <xsl:with-param name="name" select="'Pending Approval'" />
                                </xsl:call-template>
                                <xsl:if test=" count(Records/PendingRecords/PendingRec) = 0">
                                    <xsl:call-template name="norecords">
                                    </xsl:call-template>
                                </xsl:if>
                                <xsl:apply-templates
                                    select="Records/PendingRecords/PendingRec"></xsl:apply-templates>
                            </fo:table-body>
                        </fo:table>
                    </fo:block>
                </fo:block>
            </fo:flow>
        </fo:page-sequence>

        <!-- 6th page sequence -->
        <fo:page-sequence master-reference="page" id="myseq">
            <fo:flow flow-name="xsl-region-body">
                <fo:block>
                    <fo:block font-size="8pt">
                        <fo:table table-layout="fixed" width="100%"
                            border-collapse="collapse">
                            <fo:table-column column-width="1.5in" />
                            <fo:table-column column-width="2.5in" />
                            <fo:table-column column-width="1.5in" />
                            <fo:table-column column-width="2in" />
                            <fo:table-header border-bottom="1pt solid black">
                                <fo:table-cell padding-left="3pt"
                                    background-color="lightgrey" height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">First Name</fo:block>
                                </fo:table-cell>
                                <fo:table-cell background-color="lightgrey"
                                    height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">Last Name</fo:block>
                                </fo:table-cell>
                                <fo:table-cell background-color="lightgrey"
                                    height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">Address</fo:block>
                                </fo:table-cell>
                                <fo:table-cell background-color="lightgrey"
                                    height="0.25in" display-align="center">
                                    <fo:block background-color="lightgrey" margin-bottom="1mm"
                                        font-weight="bold">Last Changed By</fo:block>
                                </fo:table-cell>
                            </fo:table-header>

                            <fo:table-body>
                                <fo:table-row>
                                    <fo:table-cell>
                                        <fo:block></fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                                <xsl:call-template name="header.status">
                                    <xsl:with-param name="name" select="'Rejected'" />
                                </xsl:call-template>
                                <xsl:if test="count(Records/RejectedRecords/RejectedRec) = 0">
                                    <xsl:call-template name="norecords">
                                    </xsl:call-template>
                                </xsl:if>
                                <xsl:apply-templates
                                    select="Records/RejectedRecords/RejectedRec"></xsl:apply-templates>
                            </fo:table-body>
                        </fo:table>
                    </fo:block>
                </fo:block>
            </fo:flow>
        </fo:page-sequence>

    </fo:root>
</xsl:template>

<!-- ========================= -->
<!-- Report header -->
<!-- ========================= -->

<xsl:template match="Header">
    <fo:table width="100%" border-style="outset" border-width="0pt">
        <fo:table-column />
        <fo:table-column />
        <fo:table-body>
            <fo:table-row>
                <fo:table-cell display-align="center" padding="0pt">
                    <fo:block>

                        <fo:external-graphic
                            src="url({resolve-uri('images', static-base-uri()) }/test_en.png)" />
                    </fo:block>
                </fo:table-cell>
                <fo:table-cell display-align="center" padding="0pt">
                    <fo:block text-align="right">
                        <fo:external-graphic
                            src="url({resolve-uri('images', static-base-uri()) }/test_en.png)" />
                    </fo:block>
                </fo:table-cell>

            </fo:table-row>
        </fo:table-body>
    </fo:table>

    <fo:block font-size="16pt" font-weight="bold" space-after="2mm"
        color="darkblue" text-align="left">Report
    </fo:block>
    <fo:block font-size="10pt" font-weight="bold" space-after="2mm">
        <xsl:value-of select="Name" />
    </fo:block>
    <fo:block font-size="8pt" space-after="5mm">
        <fo:float float="left">
            <fo:block font-size="8pt" space-after="5mm">
                <xsl:value-of select="PublicationName" />
            </fo:block>
        </fo:float>
        <fo:block font-size="8pt" text-align="right" space-after="5mm">
            <xsl:value-of
                select="concat(
         format-dateTime(CreateReportDate, '[MNn,*-3] [D], [Y]', 'en', (), ()),' ',
         format-dateTime(CreateReportDate, '[h]:[m01]:[s01] [PN,2-2]', 'en', (), ()) )" />
        </fo:block>
    </fo:block>

    <fo:block text-align="center">
        <fo:inline-container>
            <fo:table margin-top="2mm">
                <fo:table-column column-width="3.25in" />
                <fo:table-column column-width="2in" />
                <fo:table-column column-width="2.25in" />

                <fo:table-body>
                    <fo:table-row background-color="lightblue">
                        <fo:table-cell padding-left="3pt" height="0.25in"
                            display-align="center">
                            <fo:block text-align="left" background-color="lightblue"
                                color="darkblue" font-size="6pt">
                                Status:
                                <fo:inline color="black">
                                    <xsl:value-of select="Status" />
                                </fo:inline>
                            </fo:block>
                        </fo:table-cell>
                        <fo:table-cell height="0.25in" display-align="center">
                            <fo:block font-size="6pt" background-color="lightblue"
                                color="darkblue" text-align="right">
                                Created Date:
                                <fo:inline color="black">
                                    <xsl:value-of
                                        select="concat(
              format-date(CreatedDateFrom, '[MNn,*-3] [D], [Y]', 'en', (), ()), ' - ',
              format-date(CreatedDateTo, '[MNn,*-3] [D], [Y]', 'en', (), ())
              )" />
                                </fo:inline>
                            </fo:block>
                        </fo:table-cell>
                        <fo:table-cell padding-right="3pt" height="0.25in"
                            display-align="center">
                            <fo:block font-size="6pt" background-color="lightblue"
                                color="darkblue" text-align="right">
                                Last Edited Date:
                                <fo:inline color="black">
                                    <xsl:value-of
                                        select="concat(
             format-date(LastEditedDateFrom, '[MNn,*-3] [D], [Y]', 'en', (), ()), ' - ',
              format-date(LastEditedDateTo, '[MNn,*-3] [D], [Y]', 'en', (), ())
             )" />
                                </fo:inline>
                            </fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                </fo:table-body>
            </fo:table>
        </fo:inline-container>
    </fo:block>
</xsl:template>

<!-- ========================= -->
<!-- child element: Record -->
<!-- ========================= -->

<xsl:template
    match="Records/IncompleteRecords/IncompleteRec">

    <!-- Display records if any -->
    <fo:table-row border-bottom="0.5pt solid black">
        <fo:table-cell padding-left="3pt" padding-before="3pt"
            padding-after="3pt">
            <fo:block>
                <xsl:value-of select="First Name" />
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding-before="3pt" padding-after="3pt">
            <fo:block>
                <xsl:value-of select="Last Name" />
            </fo:block>
            <fo:block>
                <xsl:value-of select="Address" />
            </fo:block>
            <fo:block>
                <xsl:value-of select="Last Changed By" />
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding-before="3pt" padding-after="3pt">
            <fo:block>
                <xsl:value-of
                    select="format-date(ChangeDate, '[MNn,*-3] [D], [Y]', 'en', (), ())" />
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding-before="3pt" padding-after="3pt">
            <fo:block>
                <xsl:value-of select="LastChangedBy" />
            </fo:block>
        </fo:table-cell>
    </fo:table-row>
</xsl:template>
<!-- ========================= -->
<!-- child element: Record -->
<!-- ========================= -->
<xsl:template
    match="Records/ApprovedRecords/ApprovedRec">
    <fo:table-row border-bottom="0.5pt solid black">
        <fo:table-cell padding-left="3pt" padding-before="3pt"
            padding-after="3pt">
            <fo:block>
                <xsl:value-of select="First Name" />
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding-before="3pt" padding-after="3pt">
            <fo:block>
                <xsl:value-of select="Last Name" />
            </fo:block>
            <fo:block>
                <xsl:value-of select="Address" />
            </fo:block>
            <fo:block>
                <xsl:value-of select="Last Changed By" />
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding-before="3pt" padding-after="3pt">
            <fo:block>
                <xsl:value-of
                    select="format-date(ChangeDate, '[MNn,*-3] [D], [Y]', 'en', (), ())" />
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding-before="3pt" padding-after="3pt">
            <fo:block>
                <xsl:value-of select="LastChangedBy" />
            </fo:block>
        </fo:table-cell>
    </fo:table-row>
</xsl:template>
<!-- ========================= -->
<!-- child element: Record -->
<!-- ========================= -->
<xsl:template match="Records/DeletedRecords/DeletedRec">
    <fo:table-row border-bottom="0.5pt solid black">
        <fo:table-cell padding-left="3pt" padding-before="3pt"
            padding-after="3pt">
            <fo:block>
                <xsl:value-of select="First Name" />
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding-before="3pt" padding-after="3pt">
            <fo:block>
                <xsl:value-of select="Last Name" />
            </fo:block>
            <fo:block>
                <xsl:value-of select="Address" />
            </fo:block>
            <fo:block>
                <xsl:value-of select="Last Changed By" />
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding-before="3pt" padding-after="3pt">
            <fo:block>
                <xsl:value-of
                    select="format-date(ChangeDate, '[MNn,*-3] [D], [Y]', 'en', (), ())" />
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding-before="3pt" padding-after="3pt">
            <fo:block>
                <xsl:value-of select="LastChangedBy" />
            </fo:block>
        </fo:table-cell>
    </fo:table-row>
</xsl:template>
<!-- ========================= -->
<!-- child element: Record -->
<!-- ========================= -->
<xsl:template
    match="Records/DeactivatedRecords/DeactivatedRec">
    <fo:table-row border-bottom="0.5pt solid black">
        <fo:table-cell padding-left="3pt" padding-before="3pt"
            padding-after="3pt">
            <fo:block>
                <xsl:value-of select="First Name" />
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding-before="3pt" padding-after="3pt">
            <fo:block>
                <xsl:value-of select="Last Name" />
            </fo:block>
            <fo:block>
                <xsl:value-of select="Address" />
            </fo:block>
            <fo:block>
                <xsl:value-of select="Last Changed By" />
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding-before="3pt" padding-after="3pt">
            <fo:block>
                <xsl:value-of
                    select="format-date(ChangeDate, '[MNn,*-3] [D], [Y]', 'en', (), ())" />
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding-before="3pt" padding-after="3pt">
            <fo:block>
                <xsl:value-of select="LastChangedBy" />
            </fo:block>
        </fo:table-cell>
    </fo:table-row>
</xsl:template>
<!-- ========================= -->
<!-- child element: Record -->
<!-- ========================= -->
<xsl:template
    match="Records/PendingRecords/PendingRec">
    <fo:table-row border-bottom="0.5pt solid black">
        <fo:table-cell padding-left="3pt" padding-before="3pt"
            padding-after="3pt">
            <fo:block>
                <xsl:value-of select="First Name" />
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding-before="3pt" padding-after="3pt">
            <fo:block>
                <xsl:value-of select="Last Name" />
            </fo:block>
            <fo:block>
                <xsl:value-of select="Address" />
            </fo:block>
            <fo:block>
                <xsl:value-of select="Last Changed By" />
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding-before="3pt" padding-after="3pt">
            <fo:block>
                <xsl:value-of
                    select="format-date(ChangeDate, '[MNn,*-3] [D], [Y]', 'en', (), ())" />
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding-before="3pt" padding-after="3pt">
            <fo:block>
                <xsl:value-of select="LastChangedBy" />
            </fo:block>
        </fo:table-cell>
    </fo:table-row>
</xsl:template>
<!-- ========================= -->
<!-- child element: Record -->
<!-- ========================= -->
<xsl:template
    match="Records/RejectedRecords/RejectedRec">
    <fo:table-row border-bottom="0.5pt solid black">
        <fo:table-cell padding-left="3pt" padding-before="3pt"
            padding-after="3pt">
            <fo:block>
                <xsl:value-of select="First Name" />
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding-before="3pt" padding-after="3pt">
            <fo:block>
                <xsl:value-of select="Last Name" />
            </fo:block>
            <fo:block>
                <xsl:value-of select="Address" />
            </fo:block>
            <fo:block>
                <xsl:value-of select="Last Changed By" />
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding-before="3pt" padding-after="3pt">
            <fo:block>
                <xsl:value-of
                    select="format-date(ChangeDate, '[MNn,*-3] [D], [Y]', 'en', (), ())" />
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding-before="3pt" padding-after="3pt">
            <fo:block>
                <xsl:value-of select="LastChangedBy" />
            </fo:block>
        </fo:table-cell>
    </fo:table-row>
</xsl:template>

<!-- ========================= -->
<!-- Display Table header -->
<!-- ========================= -->

<xsl:template name="header.status">
    <xsl:param name="name" />
    <fo:table-row>
        <fo:table-cell padding-left="3pt" background-color="lightgrey"
            height="0.25in" display-align="center" number-columns-spanned="4">
            <fo:block background-color="lightgrey" font-weight="bold">
                Status:
                <xsl:value-of select="$name" />
            </fo:block>
        </fo:table-cell>
    </fo:table-row>
</xsl:template>

<!-- ========================= -->
<!-- Display No records -->
<!-- ========================= -->
<xsl:template name="norecords">
    <fo:table-row>
        <fo:table-cell height="0.25in" display-align="center"
            number-columns-spanned="4">
            <fo:block margin-bottom="1mm" text-align="center">
                No records found
            </fo:block>
        </fo:table-cell>
    </fo:table-row>
</xsl:template>
</xsl: stylesheet>

共有2个答案

邢心水
2023-03-14

这是一个已知的问题,我认为您只需不断增加服务器的RAM,直到达到无法超越的极限。我以前用70gig ram生成过一些非常大的pdf。

邢昂然
2023-03-14

如果每个表格行都是相同的高度,即每个页面都有相同的行数,那么您可以通过制作多个表格,每个表格都有一个页面的行,来假装表格在多个页面上断开。

 类似资料:
  • 问题内容: 我是Netbeans中这种错误的新手。我一直在使用Java Bean 8.0.2在Java J2SE中工作。我正在对字符串进行模糊搜索,通常字符串长度为300-500。我正在使用Levenshtein和Jaro Winkler算法来查找字符串之间的距离。大约有1500次迭代来查找字符串之间的距离!问题是我的Net Bean通常会为以下内容提供错误: 我已经在线进行了一些搜索来摆脱此错误

  • 上周,我们在生产环境中遇到了内存不足的错误。这种内存不足的错误可能每周发生一次,当前的解决方案是重新启动应用程序服务器。我们使用的是glassfish 3.0.1。生成的堆转储约为5GB。 请帮助分析下面的堆转储。下面是使用eclipse MAT生成的泄漏嫌疑人报告。我们如何分析下面的报告?

  • 问题内容: 我正在尝试运行ant任务,但是出现以下错误: 我尝试使用谷歌搜索来查找如何设置此值,但找不到。我努力了 我努力了 但我仍然遇到同样的例外。我尝试将值成功增加到1024m 更新资料 我解决了 它与很少的内存无关。在我的javadoc一代中,这是一个无休止的循环。 问题答案: 我解决了 它与很少的内存无关。在我的javadoc一代中,这是一个无休止的循环。 为ant设置更多内存的正确方法是

  • 我的spark程序在小数据集上运行良好。(大约400GB)但是当我将其扩展到大型数据集时。我开始得到错误

  • 我正在努力解决古老的字谜问题。多亏了许多教程,我能够迭代一组字符串,递归地找到所有的排列,然后将它们与英语单词列表进行比较。我发现的问题是,在大约三个单词之后(通常是关于“变形”之类的东西),我会得到一个OutOfMemory错误。我试着把我的批分成小的集合,因为它似乎是消耗我所有内存的递归部分。但即使只是“变形”也把它锁起来了... 编辑:根据出色的反馈,我已经将生成器从排列更改为工作查找: 它

  • 问题内容: 我尝试按照此http://hadoop.apache.org/common/docs/stable/single_node_setup.html文档安装Hadoop 。当我尝试执行此 我收到以下异常 请提出一个解决方案,以便我可以尝试该示例。整个异常在下面列出。我是Hadoop的新手,我可能做过一些愚蠢的事情。任何建议将不胜感激。 问题答案: 您可以通过编辑conf / mapred-