You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by tl56 <te...@gmail.com> on 2009/07/13 20:44:24 UTC

horizontal foreach output

Hello
I am new to velocity so please excuse me if this is a foolish question, but
I have a foreach loop and I'd like to display the data within an excel
sheet(exporting data to excel)like the following
20 20 40 50 instead of 
20
20
40
50. 
My code:
#foreach($row in $data) 
<Row>
 <Cell><Data ss:Type="Number">$row.year</Data></Cell>
   </Row>
   #end
I can only display it vertically right now. 
Thank you in advance. 
-- 
View this message in context: http://www.nabble.com/horizontal-foreach-output-tp24467119p24467119.html
Sent from the Velocity - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


Re: horizontal foreach output

Posted by Nathan Bubna <nb...@gmail.com>.
On Tue, Jul 14, 2009 at 12:09 AM, Byron Foster<by...@base2.cc> wrote:
> On Jul 13, 2009, at 11:44 , tl56 wrote:
>
>> Hello
>> I am new to velocity so please excuse me if this is a foolish question,
>> but
>> I have a foreach loop and I'd like to display the data within an excel
>> sheet(exporting data to excel)like the following
>> 20 20 40 50 instead of
>> 20
>> 20
>> 40
>> 50.
>> My code:
>> #foreach($row in $data)
>> <Row>
>> <Cell><Data ss:Type="Number">$row.year</Data></Cell>
>>  </Row>
>>  #end
>> I can only display it vertically right now.
>> Thank you in advance.
>
> This question is more appropriate for the user list, not the development
> list.
>
> Since you are not generating raw text, the presentation of the data has
> little to do with Velocity.  In your above example you seem to be generating
> XML.  The interpreter of this XML, maybe Excel in this case, will determine
> how the data is displayed.  I would begin your research there.

though, i would guess something like:
<Row>
#foreach($row in $data)
<Cell><Data ss:Type="Number">$row.year</Data></Cell>
 #end
 </Row>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


Re: horizontal foreach output

Posted by Byron Foster <by...@base2.cc>.
On Jul 13, 2009, at 11:44 , tl56 wrote:

> Hello
> I am new to velocity so please excuse me if this is a foolish  
> question, but
> I have a foreach loop and I'd like to display the data within an excel
> sheet(exporting data to excel)like the following
> 20 20 40 50 instead of
> 20
> 20
> 40
> 50.
> My code:
> #foreach($row in $data)
> <Row>
> <Cell><Data ss:Type="Number">$row.year</Data></Cell>
>   </Row>
>   #end
> I can only display it vertically right now.
> Thank you in advance.

This question is more appropriate for the user list, not the  
development list.

Since you are not generating raw text, the presentation of the data  
has little to do with Velocity.  In your above example you seem to be  
generating XML.  The interpreter of this XML, maybe Excel in this  
case, will determine how the data is displayed.  I would begin your  
research there.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org