Posted 23 April 2019, 1:26 pm EST
Hi,
I I have a simple excel import/export site written with Angular.
See the screenshot below:
https://ibb.co/B63cB7c
I wanna do some calculations and formating over buttons and self written functions, e.g. the button ‘Do some magic’
I have a function
doThings(args) {
const self = this;
self.spread = args.spread;
const sheet = self.spread.getActiveSheet();
// sheet.getCell(0, 0).text('Test Excel').foreColor('blue');
// sheet.getCell(1, 1).backColor('blue');
console.log(args);
}
but I get errors when pressing it.
ERROR TypeError: Cannot read property 'spread' of undefined
at ImportExportComponent.push../src/app/import-export/import-export.component.ts.ImportExportComponent.doThings (import-export.component.ts:61)
at Object.eval [as handleEvent] (ImportExportComponent.html:15)
at handleEvent (core.js:23107)
at callWithDebugContext (core.js:24177)
at Object.debugHandleEvent [as handleEvent] (core.js:23904)
at dispatchEvent (core.js:20556)
at core.js:21003
at HTMLButtonElement.<anonymous> (platform-browser.js:993)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Object.onInvokeTask (core.js:17290)
Has anybody sample code, how I cen get access to the workbook over a function and do cell manipulations and formatting?
Thanks in advance!
BR
