Professional Documents
Culture Documents
Cetak Surat 1
Cetak Surat 1
php
ob_start();
//include classes
include_once('opentbs/tbs_class.php');
include_once('opentbs/tbs_plugin_opentbs.php');
//------------------------
//Siapkan data
//------------------------
$data[] = array();
$data[] = array('OrderID' => '1', 'ProductID' => 'S', 'UnitPrice' => '10');
$data[] = array('OrderID' => '1', 'ProductID' => 'R', 'UnitPrice' => '15');
$data[] = array('OrderID' => '1', 'ProductID' => 'W', 'UnitPrice' => '8');
$template = 'template.xlsx';
$TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
//----------------------------------------------------
// Merge data in the body of the document
//----------------------------------------------------
$TBS->MergeBlock('data' $data);
$TBS->MergeBlock('waktu' $datawaktu);
//------------------------
// Output the result
//------------------------
$TBS->Show(OPENTBS_DOWNLOAD, 'hasil_contoh1.xlsx');
exit();
<?php