Page 1 of 1

Excel Exporter example in Angular

Posted: Thu Jul 11, 2019 1:05 pm
by proteams-kaan
Is it possible to give an example project setup for using ExcelExporter in angular?

I've added zipcelx.js to the scripts in angular.js file.
But no matter what I try for the ExcelExporter.umd.js I can't get it registered with the GridFeatureManager.

I'm using bryntum-grid as suggested via a local package reference in package.json to the build directory in the distribution.

Any help would be much appreciated.

Br,
Kaan.

Re: Excel Exporter example in Angular

Posted: Tue Jul 16, 2019 7:00 am
by proteams-kaan
Minor related issue: ExcelExporter relies on ObjectHelper. ObjectHelper is not exported in d.ts files

Re: Excel Exporter example in Angular

Posted: Tue Jul 16, 2019 8:09 am
by proteams-kaan
For what it's worth I've managed to get this working.

For anyone interested, the modifications I had to make are outlined here: https://gist.github.com/kaandok/e54f05e6f6639befae993c724e3818a0

I don't have any doubts about angular.json modification for zipcelx and registering the feature with the feature manager somewhere.

But I'd appreciate if someone from Bryntum team takes a look at ExcelExporter.ts and maybe comment on whether the additional field declarations are actually needed or even whether there is a more elegant way to achieve the results without creating a ts file?

It'd also be great if we could get the ObjectHelper declared properly in both grid.d.ts and grid.umd.d.ts files in build artifacts.

Re: Excel Exporter example in Angular

Posted: Tue Jul 16, 2019 10:16 am
by pmiklashevich
Hello Kaan,

Sorry for the delay. I've fixed the d.ts file. ObjectHelper will be there in the next nightly build and next release. About copying ExcelExporter completely to create *.ts file, I don't think it's a good idea. It's better to have ExcelExporter.d.ts file and import it as is. Otherwise it will be hard to support the code base if we decide to change something in the sources. I've created a feature request for that: https://app.assembla.com/spaces/bryntum/tickets/8926-should-be-possible-to-use-excelexporter-with-typescript/details

Best,
Pavel

Re: Excel Exporter example in Angular

Posted: Wed Oct 02, 2019 2:08 pm
by proteams-kaan
Hi, the linked issue is closed as won't fix.

Are there any plans to make the excelexporter part of the core?
The dependency to zipxcel.js isn't much of an issue as long as it's properly documented imho.

The workaround I posted requires disabling optimizations in angular builds.
(optimization: false is needed in angular.json)

Is there an official way to use the exporter in angular apps?

Re: Excel Exporter example in Angular

Posted: Wed Oct 02, 2019 2:58 pm
by sergey.maltsev
Hi, proteams-kaan!

Yes, we have a plan to release it in 2.3.
It is already available nightly builds suffixed with -next.