Export to Word or PDF with own template

Tips submitted by PHPMaker users
Post Reply
mpol_ch
User
Posts: 877
Location: Switzerland

Export to Word or PDF with own template

Post by mpol_ch »

Hello

Is there some information on internet how to export the content of a record to user template in format PDF or WORD? It will be nice to have some "howto" that show how to export a record for example xml or word into a user template. Any hints will be appreciated.

mpol_ch


digitalphotoworld
User
Posts: 416
Location: Nürnberg/Germany

Post by digitalphotoworld »

Try tinybutstrong: tinybutstrong.com/plugins/opentbs/demo/demo.html

It's a great template-system wich is very easy to use. You could create a word/open-office template and tinybutstrong fill this file with data. I use it since several years and like the easy way to handle it.


mpol_ch
User
Posts: 877
Location: Switzerland

Post by mpol_ch »

Hello digitalphotoworld

Have you an existing example with PHPMAKER? Ic checked it bit it seems that I need some more time to understand it.
It will be gread for an small howto in connection to PHPMAKER.

thanks
mpol_ch


mpol_ch
User
Posts: 877
Location: Switzerland

Post by mpol_ch »

Hello
I am trying to generade a saved document with Row_Inserted event with help of TinxButStrong. Unfortunately it does not generate the output.
Could you please advise where to put the code or give me some hints where to start?

Thanks
mpol_ch

// Row Inserted event
function Row_Inserted($rsold, &$rsnew) {
//echo "Row Inserted"

include_once('tbs_us/tbs_class.php');
include_once('tbs_plugin_opentbs/tbs_plugin_opentbs.php');

$TBS = new clsTinyButStrong;
//$TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
$TBS->LoadTemplate('vorlage.docx', 'UTF-8');
$message = $rsnew["con_name"];
$TBS->VarRef['message'] = $message;
$filename='lomo.docx';


$TBS->Show(OPENTBS_DOWNLOAD, $filename);
}


digitalphotoworld
User
Posts: 416
Location: Nürnberg/Germany

Post by digitalphotoworld »

You have comented out the Plugin. Without the plugin, your code can't work!


mpol_ch
User
Posts: 877
Location: Switzerland

Post by mpol_ch »

Yes, you are right. It works now.

I am using the following code in template. It works but it does an empty row between the records or it just do a new table for each records in my MS WORD. I tried many options for block but no success. I want to see results (are from MySQL) like a table. Row by row and now spave between the rows.
Do you have an idea?

thanks
mpol_ch

[pp;block=begin]
[pp.Position] [pp.Menge] [pp.Preis] [pp.Total]
[pp;block=end]


oliveira
User
Posts: 45

Post by oliveira »

I use firefox save as, all files, filename.doc


oliveira
User
Posts: 45

Post by oliveira »

In google chrome> print> save as pdf file. Is good


Post Reply