xsl-list
[Top] [All Lists]

Re: Re: Re: Re: Pagebreaks in Excel-HTML transformer

2006-02-12 21:32:36
Guys,

Let me ask you a few things, because my impression is that you are
talking about 2 different things, and when I am trying to consider it as one,
I am getting confused.

c>I was suggesting that you use some other means (other than XSLT) to
c>produce a binary native Excel file that you output to disk and insert a link
c>into the HTML output that would download the binary file when clicked.
Does that mean a completely different approach outside not only XSLT
but Cocoon as well ?
If that is a case, I will probably not follow it, because I am dealing
with Cocoon applications,
any breach from that will be taken hard by my client and my manager.

g>Oleg, as I mentioned before and Charles mentioned again here, if you
g>want to produce Excel worksheets, the most reliable way is to create a
g>binary file.  Did you look at the information I sent in my last email
g>about how to use Cocoon pipelining to produce a binary excel file?  As
g>far as I can tell it seems a typical thing to do with Cocoon.
My impression is that POI technology suggested by Jon in the link
is Cocoon based (or at least is pipeline based and seem to be integrateable
with Cocoon).
I actually sent e-mail to the author (article is written 3yrs ago) and
got his reply:

"After working with Cocoon for a long time and even publishing
several articles, I came to the conclusion a few years ago that XML
pipelines were just not the way to go: too limited and restrictive.  The
Cocoon project also seems out of control.

    Since that article I have completely re-written the Excel reports
generation software into a simply single servlet.  See www.jxreports.com.  I
attempted to make this into a commercial product, but will probably move it
into the open-source domain.  Give it a try.

    JXReports still emits a binary excel file (reverse compatible to
earlier version of Excel).  But no file is ever written to the file system."

He didn't reply to any of my questions regarding pagebreaks in Excel or
how to integrate that POI with my Cocoon pipeline.
But he seems to suggest to forget about POI and switch to JXReport.
Have you heard about it ?  Is this a better alternative to POI.

Actually, I checked all my Cocoon project, and POI was used on one of
other projects I support (to do precisely the opposite: convert Excel
file to XML),
but that code seems to be disabled for whatever reason.

Please advise me what to do.

I am attaching my current pipeline.
How do I integrage that with POI, just replace HTMLSerializer with the
one from POI?

                        <map:match pattern="cm/*sheetexcel">
                                <map:act type="getSecurityInfoAction">
                                        <map:generate type="request">
                                                <map:parameter 
name="parameters" value="true"/>
                                        </map:generate>
                                        <map:transform type="xslt" 
src="xslt/cm/{../1}sheet-query.xsl"
label="debug">
                                                <map:parameter 
name="sec_user_id" value="{userId}"/>
                                                <map:parameter name="page" 
value="{../1}sheet"/>
                                        </map:transform>
                                        <map:transform type="sql" 
label="database">
                                                <map:parameter 
name="use-connection" value="bpmdb"/>
                                        </map:transform>
                                        <map:transform type="xslt"
src="xslt/cm/{../1}sheet-transform.xsl" label="transform">
                                                <map:parameter 
name="sec_user_id" value="{userId}"/>
                                                <map:parameter name="page" 
value="{../1}sheet"/>
                                        </map:transform>
                                        <map:transform type="xslt"
src="xslt/cm/{../1}sheet-transform2.xsl" label="transform2">
                                                <map:parameter 
name="sec_user_id" value="{userId}"/>
                                                <map:parameter name="page" 
value="{../1}sheet"/>
                                        </map:transform>
                                        <map:transform type="xslt"
src="xslt/cm/{../1}sheet-transform3.xsl" label="transform3">
                                                <map:parameter 
name="sec_user_id" value="{userId}"/>
                                                <map:parameter name="page" 
value="{../1}sheet"/>
                                        </map:transform>                        
                
                                        <map:transform type="xslt" 
src="xslt/cm/excel-html-transform.xsl"
label="html">
                                                <map:parameter 
name="sec_user_id" value="{userId}"/>
                                                <map:parameter name="page" 
value="{../1}sheet"/>
                                        </map:transform>
                                        <!--that is where I can create 
page-break-after to be eaten by
serializer  -->
                                        <map:serialize type="fakeout-xls"/>
                                </map:act>
                        </map:match>
where :
<map:serializers default="html">
   <map:serializer name="fakeout-xls" mime-type="application/vnd.ms-excel"
        src="org.apache.cocoon.serialization.HTMLSerializer"/>                  
</map:serializers>

TIA,
Oleg.





On 2/9/06, Oleg Konovalov <olegkon(_at_)gmail(_dot_)com> wrote:
Charles/Jon,

I was thinking that it might be possible to find an easier fix
for the problem I have than introducing such Excel binary file solution
(and POI technology which I am totally unfamiliar with)
Mind you, it is a problem with only 2 reports (all others are fine).
It would be pretty undesirable that they behave totally different
from the user's perspective.
But I will look more into it.

If you can tell me what element will cause Excel to create a new worksheet, I
can show you how to insert it into your output.
I did not find the answer after some googling around, but is it possible that
simply replacing <page-break> with "</x:WorkSheet><x:WorkSheet>" can do that ?
And subsequent HTMLSerializer with mime type Excel will interpret it.
That would be a much much simplier solution.

What do you think ?

I will also experiment more with regard to why me and Charles
are seeing different results with page-break after that transformation.

Thank you,
Oleg.


On 2/9/06, Jon Gorman <jonathan(_dot_)gorman(_at_)gmail(_dot_)com> wrote:
I was suggesting that you use some other means (other than XSLT) to
produce a binary native Excel file that you output to disk and insert a 
link
into the HTML output that would download the binary file when clicked.

Oleg, as I mentioned before and Charles mentioned again here, if you
want to produce Excel worksheets, the most reliable way is to create a
binary file.  Did you look at the information I sent in my last email
about how to use Cocoon pipelining to produce a binary excel file?  As
far as I can tell it seems a typical thing to do with Cocoon.  I do
believe I've also seen Cocoon pipelines that did things like take in a
SVG source and produced a variety of images from it.



Jon Gorman

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--