You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Anna Bikkina <an...@pinksheets.com> on 2004/03/05 22:47:24 UTC

Need help on generating excel

Hi,

I am a application that has to generate html and excel with the same data. For 
now  I am trying to have 2 buttons one which would perform the query and 
display it in html
 
	 <map:generate src="security.xsp" type="serverpages"/>
        <map:transform src="context:/historyserver/styles/search.xsl"/>     
        <map:serialize/> 

where search.xsl is written to convert data to html tables.

I have another button which converts the same data to excel . It performs 
query to the database and is expected to display data in excel. I am using 
the org.apache.cocoon.serialization.HSSFSerializer to perform this.

	 <map:generate src="security.xsp" type="serverpages" label="raw"/>
        <map:transform src="context:/historyserver/styles/page2xls.xsl"/>     
        <map:serialize type="xls"/> 


The first one works but the second one does not create a excel file. 
When I view the xml that is  generated using views(with label raw) and copy 
the content to a xml file and use that as input to transform and then 
serialize to xls that works. It displays the output in excel.

 I am not understanding where it is going wrong. 

Can someone please tell me where I am going wrong. I have been trying to work 
on my sitemap and xsl files for over 2 days now but could not find the 
solution.

Thanks,
Anna.


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


Re: Need help on generating excel

Posted by Anna Bikkina <an...@pinksheets.com>.
 I am using serverpages generator to genarate xml from the xsp's. I use the
 same xsp in both the cases. I am wondering what difference could be there
 in the generated SAX events.  The only change in my sitemap in both the
 match statements  is the transformer and the serializer after the
 generator.

 I got the view from the generator and serialized to xls and checked it. It
 looks perfect. As I said when I copy this file to a location in my machine
 and use it instead of the generator and then have the page2xls.xsl
 tranformer and seriliaze the tranformed output using HSSSerializer(xls) it
 works.

 I changed my match pipeline in the sitemap
 	 <map:generate src="security.xsp" type="serverpages" label="raw"/>
          <map:transform src="context:/historyserver/styles/page2xls.xsl"/>
          <map:serialize type="xls"/>

 My view looks like this
 	<map:view lable="raw" name="raw">
 		<map:tranform src="context:/historyserver/styles/page2xls.xsl"/>
 		<map:serialize type="xls"/>
 	</map:view>

 I am wondering why my view is working and my match pipeline is not working.
 They are doing just the same thing. Can you please tell me what I am
 missing here.

 Thanks in advance,
 Anna.


> On Monday 08 March 2004 05:06 pm, you wrote:
> > If you get different behavior from your xsp than from a file generator
> > that suggests the stream of generated SAX events is not the same (even
> > though when serialized as XML it looks the same). You could try using the
> > LogTransformer to see how the two SAX streams differ.
> > But first I'd examine the transformed XML in both cases as that might be
> > enough to point you in the right direction.
> > Maybe the xsp isn't using namespaces correctly.
> > Cheers,
> > 	Neil.
> >
> > -----Original Message-----
> > From: users-return-64245-nbacon=aisoftware.com.au@cocoon.apache.org
> > [mailto:users-return-64245-nbacon=aisoftware.com.au@cocoon.apache.org]On
> > Behalf Of Anna Bikkina
> > Sent: Tuesday, 9 March 2004 8:31 AM
> > To: users@cocoon.apache.org
> > Subject: Re: Need help on generating excel
> >
> >
> > Can someone please answer my question.
> >
> > Thanks in advance,
> > Anna.
> >
> > On Friday 05 March 2004 04:47 pm, Anna Bikkina wrote:
> > > Hi,
> > >
> > > I have a application that has to generate html and excel with the same
> >
> > data.
> >
> > > For now  I am trying to have 2 buttons one which would perform the
> > > query and display it in html
> > >
> > > 	 <map:generate src="security.xsp" type="serverpages"/>
> > >         <map:transform src="context:/historyserver/styles/search.xsl"/>
> > >         <map:serialize/>
> > >
> > > where search.xsl is written to convert data to html tables.
> > >
> > > I have another button which converts the same data to excel . It
> > > performs query to the database and is expected to display data in
> > > excel. I am using the org.apache.cocoon.serialization.HSSFSerializer to
> > > perform this.
> > >
> > > 	 <map:generate src="security.xsp" type="serverpages" label="raw"/>
> > >         <map:transform
> > > src="context:/historyserver/styles/page2xls.xsl"/> <map:serialize
> > > type="xls"/>
> > >
> > >
> > > The first one works but the second one does not create a excel file. It
> >
> > creates an ill formatted html.
> >
> > > When I view the xml that is  generated using views(with label raw) and
> >
> > copy
> >
> > > the content to a xml file and use that as input to transform and then
> > > serialize to xls that works. It displays the output in excel.
> > >
> > >  I am not understanding where it is going wrong.
> > >
> > > Can someone please tell me where I am going wrong. I have been trying
> > > to work on my sitemap and xsl files for over 2 days now but could not
> > > find
> >
> > the
> >
> > > solution.
> > >
> > > Thanks,
> > > Anna.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org


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


RE: Need help on generating excel

Posted by Neil Bacon <nb...@pinnaclesoftware.com.au>.
If you get different behavior from your xsp than from a file generator
that suggests the stream of generated SAX events is not the same (even
though when serialized as XML it looks the same). You could try using the
LogTransformer to see how the two SAX streams differ.
But first I'd examine the transformed XML in both cases as that might be
enough to point you in the right direction.
Maybe the xsp isn't using namespaces correctly.
Cheers,
	Neil.

-----Original Message-----
From: users-return-64245-nbacon=aisoftware.com.au@cocoon.apache.org
[mailto:users-return-64245-nbacon=aisoftware.com.au@cocoon.apache.org]On
Behalf Of Anna Bikkina
Sent: Tuesday, 9 March 2004 8:31 AM
To: users@cocoon.apache.org
Subject: Re: Need help on generating excel


Can someone please answer my question.

Thanks in advance,
Anna.


On Friday 05 March 2004 04:47 pm, Anna Bikkina wrote:
> Hi,
>
> I have a application that has to generate html and excel with the same
data.
> For now  I am trying to have 2 buttons one which would perform the query
> and display it in html
>
> 	 <map:generate src="security.xsp" type="serverpages"/>
>         <map:transform src="context:/historyserver/styles/search.xsl"/>
>         <map:serialize/>
>
> where search.xsl is written to convert data to html tables.
>
> I have another button which converts the same data to excel . It performs
> query to the database and is expected to display data in excel. I am using
> the org.apache.cocoon.serialization.HSSFSerializer to perform this.
>
> 	 <map:generate src="security.xsp" type="serverpages" label="raw"/>
>         <map:transform src="context:/historyserver/styles/page2xls.xsl"/>
>         <map:serialize type="xls"/>
>
>
> The first one works but the second one does not create a excel file. It
creates an ill formatted html.
> When I view the xml that is  generated using views(with label raw) and
copy
> the content to a xml file and use that as input to transform and then
> serialize to xls that works. It displays the output in excel.
>
>  I am not understanding where it is going wrong.
>
> Can someone please tell me where I am going wrong. I have been trying to
> work on my sitemap and xsl files for over 2 days now but could not find
the
> solution.
>
> Thanks,
> Anna.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


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



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


Re: Need help on generating excel

Posted by Anna Bikkina <an...@pinksheets.com>.
Can someone please answer my question.

Thanks in advance,
Anna.


On Friday 05 March 2004 04:47 pm, Anna Bikkina wrote:
> Hi,
>
> I have a application that has to generate html and excel with the same data.
> For now  I am trying to have 2 buttons one which would perform the query
> and display it in html
>
> 	 <map:generate src="security.xsp" type="serverpages"/>
>         <map:transform src="context:/historyserver/styles/search.xsl"/>
>         <map:serialize/>
>
> where search.xsl is written to convert data to html tables.
>
> I have another button which converts the same data to excel . It performs
> query to the database and is expected to display data in excel. I am using
> the org.apache.cocoon.serialization.HSSFSerializer to perform this.
>
> 	 <map:generate src="security.xsp" type="serverpages" label="raw"/>
>         <map:transform src="context:/historyserver/styles/page2xls.xsl"/>
>         <map:serialize type="xls"/>
>
>
> The first one works but the second one does not create a excel file. It 
creates an ill formatted html.
> When I view the xml that is  generated using views(with label raw) and copy
> the content to a xml file and use that as input to transform and then
> serialize to xls that works. It displays the output in excel.
>
>  I am not understanding where it is going wrong.
>
> Can someone please tell me where I am going wrong. I have been trying to
> work on my sitemap and xsl files for over 2 days now but could not find the
> solution.
>
> Thanks,
> Anna.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


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


Re: Need help on generating excel

Posted by Anna Bikkina <an...@pinksheets.com>.
This produces a html which is not formatted.

Thanks for the reply
Anna.


On Friday 05 March 2004 11:21 pm, Tim Larson wrote:
> On Fri, Mar 05, 2004 at 04:47:24PM -0500, Anna Bikkina wrote:
> <snip/>
>
> > I have another button which converts the same data to excel . It performs
> > query to the database and is expected to display data in excel. I am
> > using the org.apache.cocoon.serialization.HSSFSerializer to perform this.
> >
> > 	 <map:generate src="security.xsp" type="serverpages" label="raw"/>
> >         <map:transform src="context:/historyserver/styles/page2xls.xsl"/>
> >         <map:serialize type="xls"/>
>
> So what does this produce?  An exception, a file in some other format,
> a malformed excel file, or what?
>
> > The first one works but the second one does not create a excel file.
> > When I view the xml that is  generated using views(with label raw) and
> > copy the content to a xml file and use that as input to transform and
> > then serialize to xls that works. It displays the output in excel.
>
> --Tim Larson
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


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


Re: Need help on generating excel

Posted by Tim Larson <ti...@keow.org>.
On Fri, Mar 05, 2004 at 04:47:24PM -0500, Anna Bikkina wrote:
<snip/>
> I have another button which converts the same data to excel . It performs 
> query to the database and is expected to display data in excel. I am using 
> the org.apache.cocoon.serialization.HSSFSerializer to perform this.
> 
> 	 <map:generate src="security.xsp" type="serverpages" label="raw"/>
>         <map:transform src="context:/historyserver/styles/page2xls.xsl"/>     
>         <map:serialize type="xls"/> 

So what does this produce?  An exception, a file in some other format,
a malformed excel file, or what?

> The first one works but the second one does not create a excel file. 
> When I view the xml that is  generated using views(with label raw) and copy 
> the content to a xml file and use that as input to transform and then 
> serialize to xls that works. It displays the output in excel.

--Tim Larson

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