문제

I guess no one was lucky to found the best solution of handling reports in php, specialy when it's a .doc/x report or file .... i searched for sometime and then i found phpdocx.com .. amazing php script, but it just doesn't work, and i don't know exactly where to find the output file ... and unfortunately the documentation doesn't help at any level ...

Now i need to know the way this script work .. i mean how results come out and become usable ... and what needs it take the script to work .. because it simply doesn't work on my local host .. i am using appache 2, php 5.2.6 ..

I don't actually need more than writing html with in ( a real doc format file, not rename a html file to .doc !! ), so if there is any solution ( without the COM Lib ... i am not on a windows server ) to generate real doc file with HTML .. please but it here

Thanks very much in advance :)

도움이 되었습니까?

해결책

I guess no one was lucky to found the best solution of handling reports in php, specialy when it's a .doc/x report or file

This is not the question corresponding to the title, but you should try OpenTBS.

It's an open source PHP library which builds DOCX with the technique of templates.

No temp directory, no extra exe needed. First create your DOCX, XLSX, PPTX with Ms Office, (ODT, ODS, ODP are also supported, that's OpenOffice files). Then you use OpenTBS to load the template and change the content using the Template Engine (easy, see the demo). At the end, you save the result where you need. It can be a new file, a download flow, a PHP binary string.

OpenTBS can also change pictures and charts in a document.

다른 팁

The documentation of PHPDocX has been greatly improved. Have you tried to look at the PHPDocX tutorial? You may also have a look at the Forum.

require_once "Path of phpdocx library/CreateDocx.inc";

$docx = new CreateDocx();

$html = 'your data will store in this variable';
$docx->embedHTML(
    $html,
    array(
        'parseDivsAsPs' => true,
        'downloadImages' => true,
        'WordStyles' => array(
            '<table>' => 'MediumGrid3-accent5PHPDOCX'
        ),
        'tableStyle' => 'NormalTablePHPDOCX'
    )
);

$docx->createDocx($varPublicPath.'/word_export_file/example1_'.time());
// this is location where your docx file will generate(inside word_export_file docx file will store)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top