Skip to content

Spreadsheet footers

Footers is readonly data that goes in the footer of the spreadsheet. It can provides summary information to the user, and can include text or formulas.

The following methods are available to interact with the spreadsheet footers programmatically.

MethodDescription
getFootersGet the footers definitions for a spreadsheet.

Jworksheet getFooters(): Promise<(string | number | boolean | null)[][]>;

GET /api/:guid/:worksheetIndex/footers
setFootersRemove the current footer and apply the informed one.
@param footer - new footer data.

Jworksheet setFooters(footer: (string | undefined | null)[][]): Promise<void>

POST /api/:guid/:worksheetIndex/footers
resetFooterRemove the footer.

Jworksheet resetFooter(): Promise<void>

DELETE /api/:guid/:worksheetIndex/footers
setFooterValueChange the value of a preexisting cell in the footer.
@param x - cell column to be changed.
@param y - cell row to be changed.
@param value - new cell value.

Jworksheet setFooterValue(x: number, y: number, value: string): Promise<void>

POST /api/:guid/:worksheetIndex/footers/value
import { Client } from "@intrasheets/client";
// Create a new client
const client = new Client({
// API Server
baseUrl: "http://localhost:8009/api",
// Your authentication token
token: "eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i",
});
// Spreadsheet Guid
const guid = '15eb1171-5a64-45bf-be96-f52b6125a045';
// Get the spreadsheet instance
const spreadsheet = client.getSpreadsheet(guid);
// Get Jworksheet object
const worksheet = spreadsheet.getWorksheet(0);
// New footer
const rows = [
["1", "2"],
["3", "4"],
];
// Create the footers from the array
worksheet
.setFooters(rows)
.then(() => {
// It worked correctly
})
.catch((err) => {
// Something went wrong
console.log(err);
});
Terminal window
curl -X POST "http://localhost:8009/api/15eb1171-5a64-45bf-be96-f52b6125a045/0/footers" \
-H "Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i" \
-H "Content-Type: application/json" \
-d '{
"rows": [
["1", "2"],
["3", "4"]
]
}'
import { Client } from "@intrasheets/client";
// Create a new client
const client = new Client({
// API Server
baseUrl: "http://localhost:8009/api",
// Your authentication token
token: "eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i",
});
// Spreadsheet Guid
const guid = '15eb1171-5a64-45bf-be96-f52b6125a045';
// Get the spreadsheet instance
const spreadsheet = client.getSpreadsheet(guid);
// Get Jworksheet object
const worksheet = spreadsheet.getWorksheet(0);
// Get the footers
worksheet.getFooters().then((footer) => {
console.log(footer);
});
Terminal window
curl -X GET "http://localhost:8009/api/15eb1171-5a64-45bf-be96-f52b6125a045/0/footers" \
-H "Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i"
import { Client } from "@intrasheets/client";
// Create a new client
const client = new Client({
// API Server
baseUrl: "http://localhost:8009/api",
// Your authentication token
token: "eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i",
});
// Spreadsheet Guid
const guid = '15eb1171-5a64-45bf-be96-f52b6125a045';
// Get the spreadsheet instance
const spreadsheet = client.getSpreadsheet(guid);
// Get Jworksheet object
const worksheet = spreadsheet.getWorksheet(0);
// Set the value of the footer cell
worksheet
.setFooterValue(1, 1, "New Value")
.then(() => {
// It worked correctly
})
.catch((err) => {
// Something went wrong
console.log(err);
});
Terminal window
curl -X POST "http://localhost:8009/api/15eb1171-5a64-45bf-be96-f52b6125a045/0/footers/value" \
-H "Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i" \
-H "Content-Type: application/json" \
-d '{
"x": 1,
"y": 1,
"value": "New Value"
}'
import { Client } from "@intrasheets/client";
// Create a new client
const client = new Client({
// API Server
baseUrl: "http://localhost:8009/api",
// Your authentication token
token: "eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i",
});
// Spreadsheet Guid
const guid = '15eb1171-5a64-45bf-be96-f52b6125a045';
// Get the spreadsheet instance
const spreadsheet = client.getSpreadsheet(guid);
// Get Jworksheet object
const worksheet = spreadsheet.getWorksheet(0);
// Delete the footer definitions
worksheet
.resetFooter()
.then(() => {
// It worked correctly
})
.catch((err) => {
// Something went wrong
console.log(err);
});
Terminal window
curl -X DELETE "http://localhost:8009/api/15eb1171-5a64-45bf-be96-f52b6125a045/0/footers" \
-H "Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i"