You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Oleg Konovalov <ol...@yahoo.com> on 2006/02/08 19:59:10 UTC

PageBreaks in Excel-HTML transformer

Hi,

I am trying to fix the following bug in the large Cocoon 2.0.4 project:

In produced multi-page Excel [2000/2003] document some break-points are shifted by 3 lines
(unlike Word document). That makes it look very messy.

After some analysis, I came to the conclusion that our Excel-HTML trasformer
strips away both  <page-break> and HTML <table> elements.
I was able to re-introduce it by modifying page-break template:
instead of:  <xsl:template match="page-break"/>  introduce:
<xsl:template match="page-break"> 
        <br style="page-break-after:always;">
        </br>
</xsl:template>

However subsequent HTML serializer with mime-type="application/vnd.ms-excel"
throws away these page-break-after, and introduces its own page-break-before
in the wrong places (shifted by 3 lines):
<tr height=17 style='page-break-before:always;height:12.75pt' xmlns="">...

1) Why is that happening in a standard Cocoon HTMLTransformer (with mime type Excel)?
Is there any way to prevent it / fix that problem ?

2) Another possible alternative for us would be to put every page (table)
in a separate Excel WorkSheet (so user can print all of them hopefully separated corrected in print).
That would probably require changing page-break template (see above)
in Excel-HTML transformer.  What/how to change it so that page-break becomes
a signal to put the data in the next WorkSheet ?

Here is the part of the transformer regarding Excel (maybe I need to modify something here?):

            <xml>
                 <x:ExcelWorkbook>
                    <x:ExcelWorksheets>
                     <x:ExcelWorksheet>
                        <x:Name> discussionsheet</x:Name>
                        <x:WorksheetOptions>
                         <x:Print>
                            <x:ValidPrinterInfo/>
                            <x:Scale>80</x:Scale>
                            <x:HorizontalResolution>600</x:HorizontalResolution>
                            <x:VerticalResolution>600</x:VerticalResolution>
                         </x:Print>
                         <x:PageBreakZoom>20</x:PageBreakZoom><!-- was 60 -->
                         <x:Selected/>
                         <x:DoNotDisplayGridlines/>
                         <x:Panes>
                            <x:Pane>
                             <x:Number>3</x:Number>
                             <x:ActiveRow>1</x:ActiveRow>
                            </x:Pane>
                         </x:Panes>
                         <x:ProtectContents>False</x:ProtectContents>
                         <x:ProtectObjects>False</x:ProtectObjects>
                         <x:ProtectScenarios>False</x:ProtectScenarios>
                        </x:WorksheetOptions>
                        <x:PageBreaks>                        
                         <x:RowBreaks>
                             <xsl:for-each select="/document/helper-info/row-breaks/row">
                                <x:RowBreak>
                                    <x:Row><xsl:value-of select="."/></x:Row>
                                </x:RowBreak>
                            </xsl:for-each>
                         </x:RowBreaks>                         
                        </x:PageBreaks>
                     </x:ExcelWorksheet>
                    </x:ExcelWorksheets>
                    <x:WindowHeight>12270</x:WindowHeight>
                    <x:WindowWidth>19755</x:WindowWidth>
                    <x:WindowTopX>210</x:WindowTopX>
                    <x:WindowTopY>90</x:WindowTopY>
                    <x:ProtectStructure>False</x:ProtectStructure>
                    <x:ProtectWindows>False</x:ProtectWindows>
                 </x:ExcelWorkbook>
                </xml>

Please help !
 
Thank you in advance, 
Oleg.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org