[plug] Building a GUI app to generate a wordprocessed letter

Russell Steicke r.steicke at bom.gov.au
Mon Mar 10 20:22:27 WST 2003


On Mon, Mar 10, 2003 at 06:10:09PM +0800, Derek Fountain wrote:
> This is a bit off topic, but someone on here might have experience of what I  
> want to do.
> 
> The requirement: user enters customer name, address, and a whole pile of  
> application specific information, and the system produces a letter for them  
> (confirming an appointment in this case).
> 
> I can do the MySQL database. I can do a front end for entering data into it.  
> What I don't know how to do is feed the important fields into a decent WP so  
> it generates a letter.
> 
> Ideally the WP would be OpenOffice, in which my user could produce the nicely  
> formatted skeleton of the letter. Is it possible to do a merge-on-the-fly  
> sort of operation in OpenOffice Writer, preferably under external script 
> control? The underlying format is XML, so it sounds possible...

LaTeX would probably be a better fit for this job.  It's all plain text
so it's easy to do sed style substitutions or more on it to generate a
customised document.  (Modulo some mucking around with backslashes.) And
.tex files are normally batch processed, so you don't have to convince a
graphical word processer (ie OOo's writer) to become a batch document
processor.

You could probably use LyX to generate the first cut of the document,
export to LaTeX, and then use that as the template.  LyX will be a
little less flexible than OOo in how the document looks, but then it's
meant to be.  And that might be a good thing, depending on the
document/template ratio.

I remember someone in plug mentioning a couple of years ago that he
generates regular printed reports for an isp from their log files, some
scripting and LaTeX.  Tony BT, perhaps?




-- 
Russell Steicke

-- Fortune says:
The first time, it's a KLUDGE!
The second, a trick.
Later, it's a well-established technique!
		-- Mike Broido, Intermetrics



More information about the plug mailing list