Jspreadsheet Api

Footers

Footers is the piece of readonly data that goes in the footer of the spreadsheet. It can be used to give a summary information, including formulas. A footer working example can be found here.

Set the spreadsheet footers

<?php
require 'vendor/autoload.php';

use jspreadsheet\Jspreadsheet;

// Access token
$token = 'MSwzMTJmZWQzMWYyYTI1OWQ5OGVhMWYxOWNhMDNhYWY3ZTA2ZmVmMWQz';

// Spreadsheet Guid
$guid = '15eb1171-5a64-45bf-be96-f52b6125a045';

// Create the client instance
$client = new Jspreadsheet($token);

// Get the spreadsheet instance
$spreadsheet = $client->getSpreadsheet($guid);

// Result
$rows = [
    ['1', '2'],
    ['3', '4']
];

// Create the footers from the array
$result = $spreadsheet->setFooters($rows);

// Result
print_r($result);

// {"success":1,"message":"Updated","data":null}

Retrieving all footers

<?php
require 'vendor/autoload.php';

use jspreadsheet\Jspreadsheet;

// Access token
$token = 'MSwzMTJmZWQzMWYyYTI1OWQ5OGVhMWYxOWNhMDNhYWY3ZTA2ZmVmMWQz';

// Spreadsheet Guid
$guid = '15eb1171-5a64-45bf-be96-f52b6125a045';

// Create the client instance
$client = new Jspreadsheet($token);

// Get the spreadsheet instance
$spreadsheet = $client->getSpreadsheet($guid);

// Get the footers
$result = $spreadsheet->getFooters();

// Result
print_r($result);

// [["1","2"],["3","4"]]

Delete all footers

<?php
require 'vendor/autoload.php';

use jspreadsheet\Jspreadsheet;

// Access token
$token = 'MSwzMTJmZWQzMWYyYTI1OWQ5OGVhMWYxOWNhMDNhYWY3ZTA2ZmVmMWQz';

// Spreadsheet Guid
$guid = '15eb1171-5a64-45bf-be96-f52b6125a045';

// Create the client instance
$client = new Jspreadsheet($token);

// Get the spreadsheet instance
$spreadsheet = $client->getSpreadsheet($guid);

// Delete the footer definitions
$result = $spreadsheet->resetFooters();

// Result
print_r($result);

// {"success":1,"message":"Updated","data":null}