Re: [Templates] tt and SpreadSheet::WriteExcel

[prev] [thread] [next] [Date index for 2005/01/06]

From: Sean T Allen
Subject: Re: [Templates] tt and SpreadSheet::WriteExcel
Date: 22:40 on 06 Jan 2005
This is a multi-part message in MIME format.
--------------040105080109060301030707
Content-Type: multipart/alternative;
 boundary="------------010002070601020805030802"


--------------010002070601020805030802
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Thomas, Mark - BLS CTR wrote:

>  
>
>     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 
>      
>
> If you do that, you'd have to expose much of the 
> Spreadsheet::WriteExcel API as a TT plugin due to the convoluted way 
> SSWE and the underlying Excel binary representation work. Not only 
> would that be difficult, but it wouldn't buy you anything. You'd be 
> doing coding in TT instead of coding in perl. Perhaps that's your 
> goal? I guess I'm back to the question I started with--why?
>  
> A TT version of the SSWE API is going to be just as hostile to 
> non-programmers. Unless you build an abstraction layer like 
> Spreadsheet::WriteExcel::Simple, but currently that just handles 
> bold/non-bold row writing, not fonts, colors, widths, cell formats, etc.
>  
> - Mark.
>  
>  

Well I hacked something together. It doesnt do formatting really...
not selectable anyway. not yet... but it does at the very least use
write_string and sets cell formats to strings.

which takes care of my biggest problem.

and i can keep 1 template and just ass a 'type' as a variable to the 
template
and get

either a
csv
tsv
xls

maybe when i get done mark, i can share it with you and then i can 
answer the why.
and yeah i'm working on an abstraction layer now...



--------------010002070601020805030802
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Thomas, Mark - BLS CTR wrote:
<blockquote
 cite="midF483FBEE45D09F49903D169A6E0073240581B276@xxxxxxxx.xxx.xxx.xxx"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <title>Message</title>
  <meta content="MSHTML 6.00.2800.1479" name="GENERATOR">
  <div>&nbsp;</div>
  <blockquote
 style="border-left: 2px solid rgb(0, 0, 0); padding-left: 5px; margin-left: 5px; margin-right: 0px;">
    <div>But again I havent thought this all the way through...<br>
    <br>
but something like<br>
    <br>
[% USE sheet = spreadsheet( filetype ) %]<br>
[% FOREACH row IN rows %]<br>
[% sheet.start_row() %]<br>
[% FOREACH cell IN row.cells %]<br>
[% sheet.add_cell( cell.data ) %]<br>
[% END %]<br>
[% sheet.end_row() %]<br>
[% END %]<br>
    <br>
then you either add formatting via say an additional flag to add_cell&nbsp;<br>
    <span class="545304619-06012005"><font face="Arial" size="2">&nbsp;</font></span></div>
  </blockquote>
  <div><span class="545304619-06012005"><font face="Arial" size="2">If
you do that, you'd have to expose much of the Spreadsheet::WriteExcel
API&nbsp;as a TT plugin due to the convoluted way SSWE and the underlying
Excel binary representation work. Not only would that be difficult, but
it wouldn't buy you anything. You'd be doing coding in TT instead of
coding in perl.</font>&nbsp;<font face="Arial" size="2">Perhaps that's your
goal? I guess I'm back to the question I started with--why?</font></span></div>
  <div><span class="545304619-06012005"></span>&nbsp;</div>
  <div><span class="545304619-06012005"><font face="Arial" size="2">A
TT version of the SSWE API is going to be just as hostile to
non-programmers. Unless you build an abstraction layer like
Spreadsheet::WriteExcel::Simple, but currently that just handles
bold/non-bold row writing, not fonts, colors, widths, cell formats, etc.</font></span></div>
  <div><span class="545304619-06012005"></span>&nbsp;</div>
  <div><span class="545304619-06012005"><font face="Arial" size="2">-
Mark.</font></span></div>
  <div><span class="545304619-06012005"></span>&nbsp;</div>
  <div>&nbsp;</div>
</blockquote>
Well I hacked something together. It doesnt do formatting really... <br>
not selectable anyway. not yet... but it does at the very least use<br>
write_string and sets cell formats to strings.<br>
<br>
which takes care of my biggest problem.<br>
<br>
and i can keep 1 template and just ass a 'type' as a variable to the
template<br>
and get <br>
<br>
either a<br>
csv<br>
tsv<br>
xls<br>
<br>
maybe when i get done mark, i can share it with you and then i can
answer the why.<br>
and yeah i'm working on an abstraction layer now...<br>
<br>
<br>
</body>
</html>

--------------010002070601020805030802--

--------------040105080109060301030707
Content-Type: text/x-vcard; charset=utf-8;
 name="sean.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="sean.vcf"

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


--------------040105080109060301030707--

_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] tt and SpreadSheet::WriteExcel
Sean T Allen 14:41 on 06 Jan 2005

Re: [Templates] tt and SpreadSheet::WriteExcel
Simon Wilcox 16:22 on 06 Jan 2005

Re: [Templates] tt and SpreadSheet::WriteExcel
Mike Whitaker 16:28 on 06 Jan 2005

Re: [Templates] tt and SpreadSheet::WriteExcel
Sean T Allen 16:41 on 06 Jan 2005

Re: [Templates] tt and SpreadSheet::WriteExcel
Sean T Allen 16:37 on 06 Jan 2005

RE: [Templates] tt and SpreadSheet::WriteExcel
Thomas, Mark - BLS CTR 16:41 on 06 Jan 2005

Re: [Templates] tt and SpreadSheet::WriteExcel
Todd Freeman 16:51 on 06 Jan 2005

Re: [Templates] tt and SpreadSheet::WriteExcel
Sean T Allen 15:45 on 07 Jan 2005

Re: [Templates] tt and SpreadSheet::WriteExcel
Todd Freeman 00:14 on 08 Jan 2005

Re: [Templates] tt and SpreadSheet::WriteExcel
Sean T Allen 06:45 on 08 Jan 2005

Re: [Templates] tt and SpreadSheet::WriteExcel
Sean T Allen 16:57 on 06 Jan 2005

RE: [Templates] tt and SpreadSheet::WriteExcel
Thomas, Mark - BLS CTR 17:18 on 06 Jan 2005

Re: [Templates] tt and SpreadSheet::WriteExcel
Sean T Allen 17:27 on 06 Jan 2005

RE: [Templates] tt and SpreadSheet::WriteExcel
Thomas, Mark - BLS CTR 17:28 on 06 Jan 2005

Re: [Templates] tt and SpreadSheet::WriteExcel
Sean T Allen 18:27 on 06 Jan 2005

RE: [Templates] tt and SpreadSheet::WriteExcel
Thomas, Mark - BLS CTR 19:02 on 06 Jan 2005

Re: [Templates] tt and SpreadSheet::WriteExcel
Sean T Allen 19:45 on 06 Jan 2005

Re: [Templates] tt and SpreadSheet::WriteExcel
Sean T Allen 20:22 on 06 Jan 2005

RE: [Templates] tt and SpreadSheet::WriteExcel
Thomas, Mark - BLS CTR 20:19 on 06 Jan 2005

Re: [Templates] tt and SpreadSheet::WriteExcel
Sean T Allen 22:40 on 06 Jan 2005

Generated at 08:55 on 15 Mar 2005 by mariachi v0.52