Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
299 views
in Technique[技术] by (71.8m points)

xsl fo - Page Protect attribute in XSL FO

I need to implement XSL-FOP layout like attached image.

first Parent table "Requested Items Information". Inside there is a Child table"Item Name" and inside of it another child table"Technical Information" in that will have multiple records.

Now when page breaks then all parent tables headers should display along with grand child table name.

Attached image Second page start with "Requested Items Information" then "Item Name" then "Technical Information".

This is achieved "Page Protect" property in RDF. Now i need to implement it in XSL-FOP.

I tried page-break-inside="avoid" attribute but all the data is coming only in one page once page is fill then rest of data is not visible which means data is not at all coming to second page.

I tried keep-together="always" attribute but table content is not wrapping. data is exceeding pdf width size. However next page is not coming as needed.

Thanks in advance for suggestions and advises

Need to implement PDF like this image

Below is Code.

<fo:block margin-left="0.0cm" margin-right="0.0cm" margin-top="0.2cm" font-weight="normal" font-style="normal" color="#000000" text-align="left" >
       <fo:table border-style="solid" border-width="0.0mm">
          <fo:table-column column-width="200mm" border-style="solid" border-width="0.1mm" />          
          <fo:table-body>
             <fo:table-row height="0.2cm">
                <fo:table-cell number-columns-spanned="1">
                   <fo:block margin-left="0.2cm" margin-right="0.0cm" margin-top="0.2cm" font-size="10pt" font-weight="bold" font-style="normal" color="#000000" text-align="left">
                      Requested Items Information
                   </fo:block>
                </fo:table-cell>
            </fo:table-row>
            <fo:table-row height="0.2cm">
                <fo:table-cell number-columns-spanned="1">
                    <fo:block margin-left="0.0cm" margin-right="0.0cm" margin-top="0.2cm" font-weight="normal" font-style="normal" color="#000000" text-align="left">
                            
                       <fo:table border-style="solid" border-width="0.0mm">
                          <fo:table-column column-width="200mm" border-style="solid" border-width="0.1mm" />          
                          <fo:table-body>
                             <fo:table-row height="0.2cm" border-bottom-style="solid" border-width="0.1mm">
                                <fo:table-cell number-columns-spanned="1">
                                   <fo:block margin-left="0.2cm" margin-right="0.0cm" margin-top="0.2cm" font-size="10pt" font-weight="bold" font-style="normal" color="#000000" text-align="left">
                                      Item Name: 
                                </fo:table-cell>
                            </fo:table-row>
                            <fo:table-row height="0.2cm">
                                <fo:table-cell number-columns-spanned="1">
                                   <fo:block margin-left="0.0cm" margin-right="0.0cm" margin-top="0.2cm" font-size="10pt" font-weight="normal" font-style="normal" color="#000000" text-align="left">
                                      <fo:table border-style="solid" border-width="0.0mm">
                                      <fo:table-column column-width="42mm" border-style="solid" border-width="0.0mm" />
                                      <fo:table-column column-width="25mm" border-style="solid" border-width="0.0mm" />                                   
                                      <fo:table-column column-width="35mm" border-style="solid" border-width="0.0mm" />
                                      <fo:table-column column-width="30mm" border-style="solid" border-width="0.0mm" />
                                      <fo:table-column column-width="38mm" border-style="solid" border-width="0.0mm" />
                                      <fo:table-column column-width="30mm" border-style="solid" border-width="0.0mm" />
                                      <fo:table-body>
                                         <fo:table-row height="0.2cm">
                                            <fo:table-cell number-columns-spanned="1">
                                            <fo:block margin-left="0.0cm" margin-right="0.0cm" margin-top="0.2cm" font-size="10pt" font-weight="normal" font-style="normal" color="#000000" text-align="left">
                                                  <fo:table border-style="solid" border-width="0.0mm">
                                                      <fo:table-column column-width="200mm" border-style="solid" border-width="0.0mm" />
                                                      <fo:table-body>
                                                          <fo:table-row height="0.2cm">
                                                            <fo:table-cell number-columns-spanned="1">
                                                               <fo:block margin-left="0.2cm" margin-right="0.0cm" margin-top="0.2cm" font-size="10pt" font-weight="bold" font-style="normal" color="#000000" text-align="left">
                                                                  Technical Information
                                                               </fo:block>                                                             
                                                            </fo:table-cell>                                                                                                                
                                                        </fo:table-row>
                                                         <fo:table-row height="0.2cm">
                                                            <fo:table-cell number-columns-spanned="1">
                                                               <fo:block margin-left="0.2cm" margin-right="0.0cm" margin-top="0.2cm" font-size="10pt" font-weight="normal" font-style="normal" color="#000000" text-align="left">
                                                                 description
                                                               </fo:block>                                                             
                                                            </fo:table-cell>                                                                                                                        
                                                        </fo:table-row>
                                                    </fo:table-body>
                                                </fo:table>
                                                </fo:block>
                                            </fo:table-cell>
                                        </fo:table-row>
                                      </fo:table-body>
                                      </fo:table>                                  
                                   </fo:block>
                                </fo:table-cell>
                            </fo:table-row>
                        </fo:table-body>
                      </fo:table>   
                    </fo:block>
                </fo:table-cell>                
             </fo:table-row>
          </fo:table-body>
       </fo:table>
</fo:block>

fo:table-header is working for the issue. Thanks Tony.

However I am having an issue when page break Table is visible like broken.enter image description here Is there any way to close table when page breaks?

question from:https://stackoverflow.com/questions/65621351/page-protect-attribute-in-xsl-fo

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...