Developers might want to set style and configuration for the sheet programmatically. For such cases SpreadSheet provides 2 classes:
To start using the API libraries, take into account the following important thing:
Let's assume that you name your script file as 'api_usage.php' and place it into 'php' folder. Then:
//api_usage.php
<?php
require_once("api.php");
require_once("config.php");
$res = new PDO("mysql:dbname=$db_name;host=$db_host", $db_user, $db_pass);
$sh = new SpreadSheet($res, "1", $db_prefix);
$sh->setValue("B1", 1);
$sh->setValue("B2", "=B1-1");
$sh->setValue("B3", "=B2-2");
$sh->setValue("B4", "=B3-3");
?>
Back to top