Return-Path: Delivered-To: apmail-jakarta-turbine-user-archive@jakarta.apache.org Received: (qmail 29001 invoked by uid 500); 16 Oct 2001 02:37:01 -0000 Mailing-List: contact turbine-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: turbine-user@jakarta.apache.org Delivered-To: mailing list turbine-user@jakarta.apache.org Received: (qmail 28948 invoked from network); 16 Oct 2001 02:36:46 -0000 Message-ID: <00f801c155ea$7a56ed70$056fa8c0@darqvader> From: "Chris Crossen" To: References: <3BCAA39B.12CDEEF5@dpma.finances.gouv.fr> Subject: Re: Re: MS Excel and setContentType] Date: Mon, 15 Oct 2001 19:30:10 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N The example below uses Excel formatting and a formula. If you have any header stuff in your default template, you may have to adjust the row numbers in the formula to make it work. One thing I ran into putting this example together is the number sign (#). A typical Excel numberformat might look like: style="vnd.ms-excel.numberformat:$#,##0.00" but velocity thinks the number signs are for it. I presume there is a way to escape them. Notice that in addition to the formatting style and formula, normal html formatting like and are recognized by Excel. Have fun, Chris $data.setContentType( "application/vnd.ms-excel" )
qty item unit price extension
2 widget 5 10
2 widget case 3 6
Total whatever
----- Original Message ----- From: "Christian GARDERES" To: Sent: Monday, October 15, 2001 1:51 AM Subject: [Fwd: Re: MS Excel and setContentType] You said in this previous message that we can even embed some formating and formulas in the velocitry template. Could you post some examples? Thanks a lot. -------- Original Message -------- De: "Chris Crossen" Objet: Re: MS Excel and setContentType A: 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" To: 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:ccrossen@home.com] > Sent: Thursday, October 11, 2001 12:02 AM > To: turbine-user@jakarta.apache.org > 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" ) > > > > > > > > > >
text11
text22
> > 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" > To: > 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:Wei.Ru@botcc.com] > > > Sent: Wednesday, October 10, 2001 1:05 PM > > > To: turbine-user@jakarta.apache.org > > > 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: > turbine-user-unsubscribe@jakarta.apache.org > > > For additional commands, e-mail: > turbine-user-help@jakarta.apache.org > > > > > > > -------------------------------------------------------------------- > - > > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: > turbine-user-help@jakarta.apache.org > > > > > -------------------------------------------------------------------- - > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: turbine-user-help@jakarta.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: turbine-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: turbine-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: turbine-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: turbine-user-help@jakarta.apache.org