[olug] Report Generator
Eric Penne
epenne at olug.org
Thu May 27 21:55:50 UTC 2004
I did some hacking yesterday and today.
I started out with html. I created an HTML file with the sizes of the
pictures correct for the margins that I wanted to use in the document.
I centered them and closed the html file out. I then opened the html
document in OpenOffice and saved it as MSWord. The pictures don't hold
the resizing that I need for the margins so I dropped that path.
I then took a look at the OpenOffice format and created a simple OO
document with one picture and no text. I opened the corresponding sxw
file to look at the contents.xml file. From this I stole the centering
and sizing information that was in the file. I created a bash script
that grabbed the names of all the pictures in the directory and had it
enter all the correct information into the contents.xml file and copied
the pictures into the Picture folder contained int he sxw. I then
zipped the new sxw up and opened it in OpenOffice to save as a word
document. Worked pretty good ecxept for all the manual steps.
Now I need to figure out how to add captioning and a basic organization
of the pictures.
I have 2 types of pictures.
Setup Photos
Test Plots
The Setup photos should be organized into directories with common names
so help identify them in my script.
Radiated Emissions
Conducted Emissions
61000-4-2
61000-4-3
61000-4-4
61000-4-5
61000-4-6
61000-4-8
61000-4-11
The test plots should be organized also.
Conducted Emissions
Radiated Emissions
This would make the script fairly easy to automate the captioning and
the order that the pictures are inserted.
I could not find a Perl->Word or Perl->OOWriter interface. Even if I
did I would then have to learn Perl.
I did find some things with Python but I haven't had the time to check
them out. I would like to learn Python because I've seen that it has an
interface for some GPIB instrumentation that I would like to use to
automate some testing. Again I would have to learn Python first.
I barely know the basics of bash scripting and html so almost any
language would be a ground up learning experience for me.
I also need to check the pictures and make sure they are in landscape
not portrait. I need to pull data from another program and make it some
sort of delimited file to import into some sort of table for the xml
document.
I haven't even gotten to the part where i generate the headings for the
Setup Photos, Test Plot, Test Results, and Evaluation Criteria.
I also need a script that will generate the correct directory structure
for all of this to work nicely. The documents are all on a Win2k server
and I'm the only person with bash. I write about 50% of the reports so
I'm not that worried about interoperabilty with my co workers yet.
I appreciate the help though and the suggestions have led me to think
about a few different ways.
Thanks
Eric Penne
More information about the OLUG
mailing list