Data from MySQL into MS Word document

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Data from MySQL into MS Word document

Post by Bill H »

Doing some preliminary investigation for a customer at this point, and need to find out if there is a relatively simple way to extract data from a MySQL database on the server and insert it into a MS Word 97 document and store the result on the server with a unique name. Details not needed at this time, but pointers to information will be most appreciated.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Have a look at PHP's COM functions for a starter.

Mac
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Post by Bill H »

Thanks for the pointer. Looking at it, I have a sinking feeling it wouldn't work on a Unix server? (Yeah, that was a question.)
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Not as far as I know, sorry.

Mac
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Nope, windows only im affraid

Mark
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Post by Bill H »

Drat. Any hope for an RTF text file? No, I thought not.

My client presently sends reports as Word docs to this customer of his as email attachments. If I convert him to the MySQL database and online forms (along with the forms for the rest of his customers) it creates a problem for creating the report in a format that can be sent to the customer in the accustomed manner. (Viewing the report online is easy, of course.)

I'm kind of reduced to suggesting outputting the report in a browser, taking a screen shot and saving it as a gif image and sending the image as an email attachment.

Any better idea present itself to you?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

What about creating a PDF?

Have a look here http://www.fpdf.org/en/home.php

Mark
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

PDF would be my choice - nice and generic.

Mac
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Post by Bill H »

You guys prove a point. A point, in fact that I've made in the past and despite which I fell into the trap myself. It is better to post what one wants to accomplish than to post the problem!

PDF is an excellent solution indeed. Thanks for the input.
Post Reply