Or thinking further still:

[% USE sheet = spreadsheet( filetype ) %]
[% FOREACH row IN rows %]
[% cells = [] %]
[% FOREACH cell IN row.cells %]
[% cells.push ( cell.data, **format** ) %]
[% END %]
[% sheet.add_row( cells ) %]
[% END %]

to style an individual cell

as to exactly how it would work for styling an entire row or column.... hmmm...

interesting... because for an excel file using SpreadSheet::WriteExcel it could just
be done at the end... I suppose for a tsv or csv or something it could either ignore
styling altogether or it starts to get pretty complicated.



Sean T Allen wrote:



Thus the idea of using a plugin that supplies various functions for spreadsheet creation inside
of a tt2 file. and depending on a runtime selection of final output excel,tsv,csv et al.
the functions would format passed in data properly in the output file.


So the plugin would provide a unified interface to styling, adding columns, adding rows etc
and could basically act as a envelope and pass the real work to whatever delegate class is
selected at the time of processing.


But again I havent thought this all the way through...

but something like

[% USE sheet = spreadsheet( filetype ) %]
[% FOREACH row IN rows %]
[% sheet.start_row() %]
[% FOREACH cell IN row.cells %]
[% sheet.add_cell( cell.data ) %]
[% END %]
[% sheet.end_row() %]
[% END %]

then you either add formatting via say an additional flag to add_cell
so you could do:

[% sheet.add_cell( cell.data, cell.style ) %]

if the data carries style info with it.

or if it doesnt but you know the 2nd loop needs to be a date...
you code hardcode there... etc etc...
whatever the possibility...

My question would be as I havent use tt2 for very long is,
can I do this:

[% USE sheet = spreadsheet( filetype ) %]
[% FOREACH row IN rows %]

[% sheet.add_row(

[% FOREACH cell IN row.cells %]
[% sheet.add_cell( cell.data ) %]
[% END %]

) %]

[% END %]

in some fashion, with blocks or something else of the sort...

so that is the basic idea of what i was thinking...





begin:vcard
fn:Sean T. Allen
n:Allen;Sean T.
org:USA Herbals, LLC
email;internet:[EMAIL PROTECTED]
title:Tech Guru
tel;work:718-388-5424
x-mozilla-html:FALSE
version:2.1
end:vcard

Reply via email to