Hi John,
I had a quick look (might need to get back to the debugger) but it was in
DefaultPage. Maybe I was too quick to draw conclusion and I could do
something w/ the layout to nullify the setDefaultDoctype() ?
There are obviouslly multiple way to workaround this but maybe there is no
workaround and there is just a solution I did not see. :)
To do an export, I'm using an action such as:
/action/MyAction/exportemplate/MyExportTemplate
(there are several possible export)
In org.apache.turbine.modules.pages.DefaultPage
public void doBuild( RunData data )
throws Exception
{
doBuildBeforeAction(data);
if ( data.hasAction() )
{
ActionLoader.getInstance().exec ( data, data.getAction() );
}
setDefaultDoctype(data);
doBuildAfterAction(data);
ScreenLoader sl = ScreenLoader.getInstance();
Screen aScreen = sl.getInstance(data.getScreen());
String layout = aScreen.getLayout(data);
if ( layout != null )
{
LayoutLoader.getInstance().exec ( data, layout );
}
else
{
ScreenLoader.getInstance().exec ( data, data.getScreen() );
}
--
St�phane Bailliez
Software Engineer, Paris - France
iMediation - http://www.imediation.com
Disclaimer: All the opinions expressed above are mine and not those from my
company.
> -----Original Message-----
> From: John McNally [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 15, 2001 5:49 PM
> To: [EMAIL PROTECTED]
> Subject: Re: MS Excel and setContentType
>
>
> RawScreen is good for binary output. If you want csv data,
> just create
> the templates to format your output however you want it. I do not
> understand your saying earlier that the Page module will add
> html markup
> to your response. Can you point to the code that does this?
>
> john mcnally
>
> Stephane Bailliez wrote:
> >
> > Ah ! thanks for putting me on the way, I discovered
> RawScreen which might be
> > a good start point for such thing.
> >
> > --
> > St�phane Bailliez
> > Software Engineer, Paris - France
> > iMediation - http://www.imediation.com
> > Disclaimer: All the opinions expressed above are mine and
> not those from my
> > company.
> >
> > > -----Original Message-----
> > > From: Chris Crossen [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, October 15, 2001 10:42 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: MS Excel and setContentType
> > >
> > >
> > > The declareDirectResponse method of RunData is probably
> what you are
> > > after.
> > >
> > > I've never used .csv files to invoke Excel from a
> browser, that was
> > > suggested by someone else. You won't get the Excel Formatting and
> > > Formula capabilities using .csv.
> > >
> > > If you have existing .csv files you want to use, you could always
> > > format them into an html table with a velocity template.
> > >
> > > Chris
> > >
> > > ----- Original Message -----
> > > From: "Stephane Bailliez" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Monday, October 15, 2001 1:31 AM
> > > Subject: RE: MS Excel and setContentType
> > >
> > >
> > >
> > > Yes I understand that this is working if you send back
> html...however
> > > if we
> > > want to send back a .csv I'm curious to know what would be the
> > > workaround.
> > >
> > > --
> > > St�phane Bailliez
> > > Software Engineer, Paris - France
> > > iMediation - http://www.imediation.com
> > > Disclaimer: All the opinions expressed above are mine
> and not those
> > > from my
> > > company.
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Chris Crossen [mailto:[EMAIL PROTECTED]]
> > > > Sent: Monday, October 15, 2001 10:16 AM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: Re: MS Excel and setContentType
> > > >
> > > >
> > > > Excel recognizes html. An html table passed to Excel will be
> > > rendered
> > > > as a spreadsheet.
> > > >
> > > > Have you tried the sample from my previous message? I
> put it into my
> > > > template directory, invoked it from IE, and Excel
> opened with the
> > > > spreadsheet you would expect to see.
> > > >
> > > > ----- Original Message -----
> > > > From: "Stephane Bailliez" <[EMAIL PROTECTED]>
> > > > To: <[EMAIL PROTECTED]>
> > > > Sent: Monday, October 15, 2001 1:11 AM
> > > > Subject: RE: MS Excel and setContentType
> > > >
> > > >
> > > >
> > > > May I ask how you manage to disable the page assembler
> to stuff a
> > > > different
> > > > content type in the response ?
> > > >
> > > > I don't see how you can send back something else
> correct since the
> > > > page
> > > > assembler will add html tags around your data...unless I missed
> > > > something I
> > > > don't see how we can do this without creating our own
> VelocityPage
> > > > that
> > > > implements a different strategy for assembling a page.
> > > >
> > > > --
> > > > St�phane Bailliez
> > > > Software Engineer, Paris - France
> > > > iMediation - http://www.imediation.com
> > > > Disclaimer: All the opinions expressed above are mine
> and not those
> > > > from my
> > > > company.
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Chris Crossen [mailto:[EMAIL PROTECTED]]
> > > > > Sent: Thursday, October 11, 2001 12:02 AM
> > > > > To: [EMAIL PROTECTED]
> > > > > Subject: Re: MS Excel and setContentType
> > > > >
> > > > >
> > > > > If you have Excel on the client (and probably if you
> are running
> > > the
> > > > > IE browser on the client), you can cause Excel to open from a
> > > page.
> > > > > You are on the right track with setting the content
> type. Put this
> > > > in
> > > > > a template and try it.
> > > > >
> > > > > $data.setContentType( "application/vnd.ms-excel" )
> > > > > <table>
> > > > > <tr>
> > > > > <td>text1</td>
> > > > > <td>1</td>
> > > > > </tr>
> > > > > <tr>
> > > > > <td>text2</td>
> > > > > <td>2</td>
> > > > > </tr>
> > > > > </table>
> > > > >
> > > > > It is even possible to put special strings in the TD
> tags to use
> > > > Excel
> > > > > formatting and Excel formulas in the resulting
> spreadsheet. Let me
> > > > > know if you want more information.
> > > > >
> > > > > Chris
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Fedor Karpelevitch" <[EMAIL PROTECTED]>
> > > > > To: <[EMAIL PROTECTED]>
> > > > > Sent: Wednesday, October 10, 2001 2:00 PM
> > > > > Subject: RE: MS Excel and setContentType
> > > > >
> > > > >
> > > > > > Cross your fingers.
> > > > > >
> > > > > > seriously. if you set cont type to something which
> the file is
> > > not
> > > > > (like in
> > > > > > your case html is not an xml spreadsheet whatever
> you are trying
> > > > to
> > > > > claim).
> > > > > > If you want to have a certain type of file to be open with
> > > certain
> > > > > app you
> > > > > > have to configure the client machine to associate
> this type with
> > > > > that app.
> > > > > > Or use an existing association (s.a. the csv hack proposed)
> > > > > >
> > > > > > fedor.
> > > > > >
> > > > > > -------------------------------
> > > > > > Amicus Plato amicus Aristoteles magis amica veritas
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Wei Ru [mailto:[EMAIL PROTECTED]]
> > > > > > > Sent: Wednesday, October 10, 2001 1:05 PM
> > > > > > > To: [EMAIL PROTECTED]
> > > > > > > Subject: MS Excel and setContentType
> > > > > > >
> > > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > I am trying to generate a report using html and
> open it on the
> > > > > browser
> > > > > > > by MS Excel. I am trying to use
> > > > > > > data.setContentType("application/vnd.ms-excel");
> then feed the
> > > > > content
> > > > > > > some dynamicly generated html text
> > > > > > > Can any one suggest me a best way to do that?
> > > > > > >
> > > > > > > Thanks
> > > > > > >
> > > > > > > Wei Ru
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> --------------------------------------------------------------------
> > > > > -
> > > > > > > To unsubscribe, e-mail:
> > > > > [EMAIL PROTECTED]
> > > > > > > For additional commands, e-mail:
> > > > > [EMAIL PROTECTED]
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> --------------------------------------------------------------------
> > > > > -
> > > > > > To unsubscribe, e-mail:
> > > > [EMAIL PROTECTED]
> > > > > > For additional commands, e-mail:
> > > > > [EMAIL PROTECTED]
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> --------------------------------------------------------------------
> > > > -
> > > > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > > > For additional commands, e-mail:
> > > > [EMAIL PROTECTED]
> > > > >
> > > >
> > > >
> --------------------------------------------------------------------
> > > -
> > > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > > >
> > > >
> > > >
> > > >
> > > >
> --------------------------------------------------------------------
> > > -
> > > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > >
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]