[Zope] Zope and Excel

pskipworth@touchcorp.com pskipworth@touchcorp.com
Wed, 8 Jan 2003 16:48:36 +1100


Another option which I use, which is prettier to the user but uglier for=
=20
the programmer, is to use an ExtMethod and pipe your data through a=20
Spreadsheet::WriteExcel Perl script. This Perl module allows you to do=20
anything that you could do within Excel, including formatting, cell=20
merging, resizing the width and height of columns/rows, etc. If only=20
someone sufficiently proficient in Perl and Python could port it to=20
Python!


=2D----Original Message-----
From: paul.browning@bristol.ac.uk [mailto:paul.browning@bristol.ac.uk]
Sent: Wednesday, 8 January 2003 4:40 PM
To: zope@zope.org
Cc: michael.healy@engitech.ie
Subject: Re: [Zope] Zope and Excel




=2D-On 07 January 2003 10:54 +0000 Miche=E1l Healy=20
<michael.healy@engitech.ie>=20
wrote:

> Hi all,
>
> I want to create a report or spreadsheet in MS Excel and populate it=20
from
> Zope.  Can anyone tell me if there is a product for Zope that will=20
help,
> or should I just look for a generic python script that does it and use=

> that.
>
> If anyone has a working example, I'd appreciate code samples and=20
anything
> else you can provide.

It ain't pretty but the following DTML Document does the job for me (and=

forces Excel to open):

=2D------------
Content-type: application/vnd.ms-excel

SURNAME<dtml-var "=5F.chr(9)">FIRST=5FNAME<dtml-var=20
"=5F.chr(9)">STUDENT=5FNUMBER<dtml-var "=5F.chr(9)">EMAIL=5FNAME<dtml-va=
r=20
"=5F.chr(9)">

<dtml-in expr=3D"students=5Fby=5Funit=5Fcode(unit=5Fcode=3D=5F['unit=5Fc=
ode'])">
<dtml-var SURNAME><dtml-var "=5F.chr(9)"><dtml-var FIRST=5FNAME><dtml-va=
r=20
"=5F.chr(9)"><dtml-var STUDENT=5FNUMBER>q<dtml-var "=5F.chr(9)"><dtml-va=
r=20
EMAIL=5FNAME><dtml-var "=5F.chr(9)">
</dtml-in>
=2D-----------

students=5Fby=5Funit=5Fcode being a SQL Method.

Paul


=2D-
 The Library, Tyndall Avenue, Univ. of Bristol, Bristol, BS8 1TJ, UK
   E-mail: paul.browning@bristol.ac.uk  URL: http://www.bris.ac.uk/


=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F
Zope maillist  -  Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )