Office and tables

cog on 2004-08-03T12:09:57

I had been given a terrible task...

Suppose you have a bunch of dimensions (tables in a database) and you have to create a document (a doc, actually), with some tables containing the records in those tables...

What to do? :-)

After stressing for a while, I realized that grabbing the files with the records, using vim to create HTML tables (with the fantastic operator s), opening them with Firefox and copy-pasting them into Office... ta-ra!! :-D Instant-tables! :-)

It was a good thing, because most of those dimensions have several hundreds of records :-)

Yes, I'm a programmer, and yes, I *am* lazy :-)


Win32::OLE

rjbs on 2004-08-03T13:16:30

I wonder if it wouldn't be lazier to use Win32::OLE. I've found that it's very reasonable and makes a lot of tasks very simple.

I generate a lot of Excel spreadsheets using DBI + Win32::OLE, and I bet it would be just as easy to do the same with Word.

or use Spreadsheet::WriteExcel

htoug on 2004-08-04T07:55:51

That will let you write Excel spreadsheet without a Windoze box near you!
Pure perl, pure goodness! Thank you jmcnamara.

Now we just need someone to do Pod::Simple::MsWord, so we can avoid Word entirely.