close
Examples
Spreadsheet cross-calculations
You can implement Excel-like formulas across different spreadsheet instances.Source code
<html> <script src="https://jspreadsheet.com/v8/jspreadsheet.js"></script> <script src="https://jsuites.net/v4/jsuites.js"></script> <link rel="stylesheet" href="https://jspreadsheet.com/v8/jspreadsheet.css" type="text/css" /> <link rel="stylesheet" href="https://jsuites.net/v4/jsuites.css" type="text/css" /> <div id="spreadsheet-1"></div><br><br> <div id="spreadsheet-2"></div> <script> // Set the JSS spreadsheet license jspreadsheet.setLicense('OWI2YmM1MGVjMmIyYzRlMzc3NTA0NGNmYzk1NDZlNGJlZmY5YmM2MzhlYTlmZDhmNzQ5MmFkZjQ4MzI2MWVhN2IyMTQ5MDFjZDdlZWQ1MWExMWZiYmZmMWM3YjI3MWU5NjY3NGNkMDQ0YjM2YzlmNGMxYmRlNjcxNDNhZDEzY2IsZXlKdVlXMWxJam9pU25Od2NtVmhaSE5vWldWMElpd2laR0YwWlNJNk1UWTNOakF3TXprNU5pd2laRzl0WVdsdUlqcGJJbXB6Y0hKbFlXUnphR1ZsZEM1amIyMGlMQ0pqYjJSbGMyRnVaR0p2ZUM1cGJ5SXNJbXB6YUdWc2JDNXVaWFFpTENKamMySXVZWEJ3SWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpJaXdpYzJOdmNHVWlPbHNpZGpjaUxDSjJPQ0lzSW5ZNUlpd2lZMmhoY25Seklpd2labTl5YlhNaUxDSm1iM0p0ZFd4aElpd2ljR0Z5YzJWeUlpd2ljbVZ1WkdWeUlpd2lZMjl0YldWdWRITWlMQ0pwYlhCdmNuUWlMQ0ppWVhJaUxDSjJZV3hwWkdGMGFXOXVjeUlzSW5ObFlYSmphQ0pkTENKa1pXMXZJanAwY25WbGZRPT0='); // Create the spreadsheets jspreadsheet(document.getElementById('spreadsheet-2'), { worksheets: [{ data: [ [ 'Crayons Crayola only (No Rose Art)', 2, 5.13, '=B1*C1' ], [ 'Colored Pencils Crayola only', 2, 4.41, '=B2*C2' ], [ 'Expo Dry-erase Markers Wide', 4, 3.00, '=B3*C3' ], [ 'Index Cards Unlined', 3, 6.00, '=B4*C4' ], [ 'Tissues', 10, 1.90, '=B5*C5' ], [ 'Ziploc Sandwich-size Bags', 5, 1.00, '=B6*C6' ], [ 'Thin Markers Crayola only', 2, 3.00, '=B7*C7' ], [ 'Highlighter', 4, 1.20, '=B8*C8' ], [ 'Total', '=SUM(B1:B8)', '=ROUND(SUM(C1:C8), 2)', '=SUM(D1:D8)' ], ], columns: [ { type: 'text', title:'Product', width:'300' }, { type: 'number', title:'Qtd', width:'80' }, { type: 'number', title:'Price', width:'100' }, { type: 'number', title:'Total', width:'100' }, ], worksheetName: 'Products', columnSorting:false, }], }); jspreadsheet(document.getElementById('spreadsheet-1'), { worksheets: [{ data: [ [ 'Price', '=SUM(Products!D1:D8)'], [ 'Discount', 0.1], [ 'Total', '=B1*(1-B2)'], ], columns: [ { type: 'text', title:'Summary', width:'300' }, { type: 'number', title:'Total', width:'200' }, ], cells: { B2: { type:'percent' } }, columnSorting:false, }], }); </script> </html>