I am wrinting some code which will benefit from a good templating system on Excel.

What I was expecting was the ability to insert TT [% ucfirst user.name %] in a binary .xls file and then run it through some "TT::Excel" and get a nice binary .xls with my data in it.

To my surprise "TT::Excel" does not exist. That is Excel::Template::TT and Excel::Template::Plus::TT (the two that come the closest to my dirty desires) use an xml template instead of a binary .xls.

My thing with the binary .xls template is it can be a really nice "user config file" for really basic users, it is really straight forward when it comes to formating WYSIWYG-ishly.

In trying to getting starter on a new module that merges TT with binary .xls templates (.xlsx would be nice too, should be covered by another nice Spreadsheet::xxxx) I have read TT docs and the Badger book to no avail (yes, "Extending the Template Toolkit" too). Seems that nobody tackles into reading a non-text based template; thus, no one goes past XML templates. I have skimmed through the code of Template::Service and Template::Provider (which seems like nice candidates) but it seems that from then on everything should be text or a really big rewrite (which is far from my abilities as was reading to full understanding the code itself).

Then comes request for thoughts on implementing this...
Maybe suggestions on an approach. My to three has: 1-Contacting someone who has this module already working by this means, failing that... 2-Reading the original .xls outputting to XML then Excel::Template::Plus::TT which will work but seems sloppy and some limitations arise from the commands being "in" the cells (specially for loops), 3-Finding some magic hook in TT where each line is read and extending that to Excel cells, 4-Using the grammar, stash and other modules from Template::Toolkit to create a new front end and never getting it done (again my limitations arise).

Comments welcome!


In reply to Binary Excel Templates by gbarco

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.