Search code examples
javascriptangularjsalasql

Alasql - How to create multiple worksheets into a workbook?


I'm trying to export data to excel workbook with multiple sheets. I had a look at the following:

The jsfiddle example works as is, But as soon as I change the lib to use the latest lib it is not working any more.

Replacing:

<script src="http://alasql.org/console/alasql.min.js"></script>
<script src="http://alasql.org/console/xlsx.core.min.js"></script>

With:

<script src="https://cdn.jsdelivr.net/alasql/0.2.3/alasql.min.js"></script>
<script src="https://cdn.jsdelivr.net/alasql/0.2.3/alasql-worker.min.js"></script>

I'm working on a AngularJS project and need to export data to excel workbook with multiple sheets. If anyone knows a way to do this please help.


Solution

  • You need to keep

    <script src="http://alasql.org/console/xlsx.core.min.js"></script>
    

    Example: http://jsfiddle.net/sd7822df/

    Please only include alasql-worker.min.js if you need it to ron as a webworker... - and avoid including alasq.min.js if you include alasql-worker.min.js