Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've used <code>Spreadsheet_Excel_Writer</code> in PHP, and it's good enough. Not WYSIWYG, but it does generate XSL files, and I'm happy with it. Afterwards, you can <a href="http://www.oooforum.org/forum/viewtopic.phtml?t=3772" rel="nofollow noreferrer">use OpenOffice macro</a> to convert the document to PDF. It works from command line, ergo, it works from PHP scripts too.</p> <p>Or here's an even better way.</p> <p>Use OpenOffice to convert a Smarty template. Smarty is a cool templating engine for PHP, I recommend it for this purpose. Then generate pure HTML using PHP with Smarty. Finally, just convert the generated HTML into PDF using aforementioned method.</p> <p>Reporting Revolutionized (tm).</p> <p><b>EDIT Jun6 2009</b> Modded down? Ah, nevermind. </p> <p>Anyways, this method works on a headless server without running X11. I've taken the script from the <a href="http://www.oooforum.org/forum/viewtopic.phtml?t=3772" rel="nofollow noreferrer">mentioned link</a> (except I put it in preexisting collection "Standard" instead of "DannysLibrary") and then I've ran this command from Windows machine using PuTTY, and X was shut down on remote machine, and DISPLAY variable was not set, and ... well, in any case, there's no way OOo could find X11 to connect to.</p> <pre><code>$ openoffice.org -invisible -headless "macro:///Standard.Conversion.ConvertWordToPDF(`pwd`/logaritamska.doc)" </code></pre> <p>This works and I'm sure this would work great for anyone who'd need conversion from another format into PDF, including production of printable reports from HTML. By editing the macro you could, perhaps, even get OOo to read directly from stdin or from your temporary service URL, and output into predefined file. The script on the <a href="http://www.oooforum.org/forum/viewtopic.phtml?t=3772" rel="nofollow noreferrer">link</a> is quite simple once you have the elementary code to expand.</p> <p>Summary:</p> <ul> <li>generate reports as XLS or HTML</li> <li>convert them</li> <li>even though it's OOo, it works on headless machines</li> </ul> <p><b>EDIT Jun 9 2009</b> I've tried to implement an online converter this way. You should make PHP run under the same user under which you created macros. This user apparently cannot be www-data. I've tried to use suphp, but for some reason it didn't change the user properly (<code>posix_getuid()</code> kept returning 33 which is www-data). I'll edit this once I fix this.</p> <p><b>EDIT Jun 26 2009</b> Guess it took me a while to report back. Yes, this works with suphp. I'm however not in position to show it live, since the only server I have runs a relatively critical web app which didn't have professional security auditing. This means one of the things we depend on to protect the backend is that the user under which frontend runs is a very very unprivileged user (such as www-data). Don't ask :-)</p> <p>Hope this helps someone: yes, converting into PDF with OO.o is quite realistic. There's even some remote calling support in OO.o but I didn't study that just for purposes of writing this.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload