我使用Apache FOP 2.2生成PDF报告。每当有超过20K的记录时,我会收到“OutofMemoryError:Java堆空间”错误。我尝试增加页面序列的数量,这提高了性能,但在将XML转换为PDF以获得超过20K的记录时,仍会出现内存不足错误。没有多个页面序列,只有2K记录成功转换。以下是使用的XML结构和XSL模板。
要求生成至少75K记录的PDF(取决于DB数据)。请建议如何修改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>
答案 0 :(得分:0)
如果每个表行的高度相同,这样每个页面的行数都相同,那么你可以通过制作多个表,每个表都有一行的行来伪造表中断多个页面。
答案 1 :(得分:0)
这是一个已知问题,我认为您只需要不断增加服务器的RAM,直到达到无法超越的极限。我以前使用70gig ram生成了一些非常大的pdf。