<br><div class="gmail_quote"><br><br><div class="gmail_quote"><div class="im">On Wed, Nov 3, 2010 at 3:20 PM, Tim Harig <span dir="ltr"><<a href="mailto:usernet@ilthio.net" target="_blank">usernet@ilthio.net</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
This page didn't make it to through to my nntp server so I appologize if I<br>
miss something that was covered.<br>
<div><br>
On 2010-11-03, Dennis Lee Bieber <<a href="mailto:wlfraed@ix.netcom.com" target="_blank">wlfraed@ix.netcom.com</a>> wrote:<br>
> On Tue, 2 Nov 2010 20:32:13 +1000, Dylan Evans <<a href="mailto:dylan@contentfree.info" target="_blank">dylan@contentfree.info</a>><br>
> declaimed the following in gmane.comp.python.general:<br>
><br>
</div><div>>> I'm setting up a database for an organisation who want to do mail merges in<br>
>> office 2010. I know i can use the MySQL ODBC driver for the mail merge but i<br>
>> have set up the database with lots of relations and many-to-many links which<br>
>> i'm sure will lead to a huge amount of confusion (I think, i don't really<br>
>> know much about mail merge).<br>
<br>
</div>Many to many relationships without some kind of intersection table are<br>
considered a rather poor practice in general.</blockquote></div><div><br>Yes an intersection table with a description char field. <br></div><div class="im"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">



<div><br>
>> What i want to know is, is there anyway to send data from python, which the<br>
>> UI is written in, to office templates and mail merges?<br>
><br>
</div><div>>       If a long lived form, I'd probably define a query or view (I think<br>
> MySQL 5.x has output-only views) that isolates just to the data fields<br>
> used in the mail merge.<br>
<br>
</div>I agree that a view would be the best solution if you have the access to do<br>
so; but, a couple of other alternatives come to mind in case you do not.<br>
<br></blockquote></div><div>That would help alot, it would certainly make it easier for then, i didn't know about views, i will rtfm.<br> </div><div class="im"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">



1. Do the mail merge in Python using a Word template.  Then you can add any<br>
        kind of logic that you need to the merge.<br>
<br></blockquote></div><div>Can this be done in pure python? Bearing in mind that the server will be linux<br> </div><div class="im"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">



2. Add some kind of export function to your python UI that allows you to<br>
        export the data to an Excel sheet, CSV, or even another ODBC data<br>
        source (like another MySQL table or database that you might have<br>
        access to).<br></blockquote></div><div><br>I have considered this one, ideally the file saving would be skipped, since it's only temporary and i am concerned that users may save many files mixing them up, or try to use old export files which are out of sync with the database. This is a community organisation with volunteers, so i expect technical competency to be low. However if i can send the data directly from python to office somehow i could avoid that issue. What would be perfect is an ODBC driver which connected via XMLRPC or some other simple protocol. <br>


<br>Thanks for the help.<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div>--<div class="im"><br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></div></blockquote></div><br><br clear="all"><div><div></div><div class="h5"><br>-- <br>"The UNIX system has a command, nice ... in order to be nice to the other users. Nobody ever uses it." - Andrew S. Tanenbaum<br>


</div></div></div><br><br clear="all"><br>-- <br>"The UNIX system has a command, nice ... in order to be nice to the other users. Nobody ever uses it." - Andrew S. Tanenbaum<br>