Forum


Replies: 4   Views: 4423
Database to word
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by jdixon2614  · 20-01-2014 - 11:05

Hi



I'm new to this forum and I'm just trying to establish whether PHPDocX will suit my requirements. So, here we go...



I need to be able to create Word documents from pieces of text (eg a paragraph) and images. We haven't decided yet whether these individual elements will be held in a database eg a MySQL db, or whether they will be stored as individual Word documents (containing, for example, one paragraph per document).



What we then need to do is to be able to search through these elements and to select some of them that will then be assembled into a Word document. So, let's say I have 200 text elements in my db and I search through them, which then gives me a list of 20 elements, some of which I will want to include in a report. I then want to be able to select some of the 20 elements, perhaps by clicking on a check box, and then to merge them together to form a single Word document.



How much of the above scenario can PhpDocX help me with?



Thanks, John


Posted by jorgelj  · 20-01-2014 - 11:29

Hello,



PHPDocX is a library to generate DOCX files creating new documents, using templates, merging documents and transforming DOCX to other formats.



So PHPDocX will helo you to create the and merge documents but you'll need to do the queries to the database and the pages of that checkboxes.



Regards.


Posted by jdixon2614  · 20-01-2014 - 11:36

Hi jorgelj - thanks for your quick response



So, for example, if I created a MySQL database and populated it with pieces of text and images, and wrote a PHP script that could search through the db records and generate a results list with check boxes against each of the results, could I then use PHPDocX to export the selected items as a single Word doc?



Thanks, John


Posted by jorgelj  · 20-01-2014 - 15:23

Hi John,



Quite so!. PHPDocX will allow you to generate DOCX documents from the results. Using the API or HTML. It's important that PHPDocX doesn't generate DOC files but DOCX.



Regards.