Thomas, Mark - BLS CTR wrote:
By xsl I meant native excel file format... and all that brings with itSean T. Allen wrote: I wasnt thinking of #1 because I wouldnt nec. know before creating a template what said formatting was and I dont want to muck with perl code after the fact. #2 was in general what I thought you were speaking of... again not something I'm terribly fond of when I think of it... I think I was going for somewhere between 3 and 4 depending on exactly what we mean by data... If by data we mean the template then 4 If by data we mean the actual data that would change from file creation to file create then 3 was what i was thinking off... 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
