2012-12-17 25 views
6

Tôi có một số bảng rất dài trải dài trên nhiều trang, được hiển thị với Apache-FOP 1.1Làm thế nào để làm cho chú thích bảng XSL-FO lặp lại trên mỗi trang khi bảng trải dài trên nhiều trang?

Bảng có chú thích, chẳng hạn như "Bảng 7.6. Chi tiết về một cái gì đó" và tiêu đề cột.

Trên mỗi trang được tiếp tục, các tiêu đề cột được lặp lại chính xác ở trên cùng. Nhưng tôi cũng cần phải có bảng tiếp tục có chú thích, theo dạng: "Bảng 7.6. Chi tiết về một cái gì đó (tiếp theo)"

Có cách nào để thực hiện điều này với XSL-FO và Apache-FOP không? hoặc nó yêu cầu phần mở rộng có lẽ có sẵn thông qua RenderX?

Trả lời

6

Tôi không biết cách nào để thực hiện nó trong FOP, nhưng điều đó có thể do tôi chưa sử dụng FOP cho bất kỳ thứ gì ngoài tạo PDF cơ bản.

Sử dụng RenderX (XEP), bạn có thể đặt fo:table-header thành bất kỳ tiêu đề nào bạn muốn sử dụng trên các trang tiếp theo và sử dụng fo:block thông thường cho tiêu đề ban đầu.

Sau đó, bạn có thể sử dụng thuộc tính rx:table-omit-initial-header="true" trên fo:table của mình để không xuất đầu trang bảng khi bảng là đầu ra đầu tiên.

Dưới đây là một ví dụ được đưa ra bởi RenderX 4.18 ...

Ví dụ XSL-FO

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" 
    xmlns:rx="http://www.renderx.com/XSL/Extensions"> 
    <fo:layout-master-set> 
     <fo:simple-page-master master-name="my-page" page-width="8.5in" page-height="11in"> 
      <fo:region-body margin="1in" margin-top="1.5in" margin-bottom="1.5in"/> 
     </fo:simple-page-master> 
    </fo:layout-master-set> 
    <fo:page-sequence master-reference="my-page"> 
     <fo:flow flow-name="xsl-region-body"> 
      <fo:block font-size="12pt" font-weight="bold" 
       text-align="center" space-after="6pt">Sample Table</fo:block> 
      <fo:block> 
       <fo:table rx:table-omit-initial-header="true" space-before=".08in"> 
        <fo:table-column column-width="100%"/> 
        <fo:table-header> 
         <fo:table-cell> 
          <fo:block font-weight="bold" 
           font-size="12pt" text-align="center" 
           space-after="6pt">Sample Table (Cont)</fo:block> 
         </fo:table-cell> 
        </fo:table-header> 
        <fo:table-body> 
         <fo:table-row> 
          <fo:table-cell> 
           <fo:table border-style="solid" border-width="1pt" padding="6pt"> 
            <fo:table-column column-number="1" column-width="20%"/> 
            <fo:table-column column-number="2" column-width="80%"/> 
            <fo:table-header font-weight="bold"> 
             <fo:table-cell text-align="left"> 
              <fo:block>Column 1</fo:block> 
             </fo:table-cell> 
             <fo:table-cell> 
              <fo:block>Column 2</fo:block> 
             </fo:table-cell> 
            </fo:table-header> 
            <fo:table-body> 
             <fo:table-row padding-before="20px"> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
             <fo:table-row> 
              <fo:table-cell> 
               <fo:block>Lorem ipsum dolor sit amet</fo:block> 
              </fo:table-cell> 
              <fo:table-cell> 
               <fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a 
                maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block> 
              </fo:table-cell> 
             </fo:table-row> 
            </fo:table-body> 
           </fo:table> 
          </fo:table-cell> 
         </fo:table-row> 
        </fo:table-body> 
       </fo:table> 
      </fo:block> 
     </fo:flow> 
    </fo:page-sequence> 
</fo:root> 

Ví dụ PDF Output Trang 1

enter image description here

Ví dụ PDF Đầu ra Trang 2

enter image description here

+1

Trước khi tôi viết rằng tôi có thể thực hiện điều này bằng công tử bột, nhưng hình như tôi hiểu lầm câu hỏi và câu trả lời. Xin lỗi vì bất kỳ sự nhầm lẫn nào. –

Các vấn đề liên quan