Update v16

Posted by: pedro.moraes on 7 February 2023, 4:56 pm EST

  • Posted 7 February 2023, 4:56 pm EST

    Hi,

    I updated to v16 but it is giving error when running the project and I use angular version 8

    ERROR in ./node_modules/@grapecity/spread-sheets-designer/dist/gc.spread.sheets.designer.all.min.js
    Module not found: Error: Can't resolve '@grapecity/spread-sheets-io' in '/home/moraes/Documentos/git/accountfy/accountfy-front/node_modules/@grapecity/spread-sheets-designer/dist'

  • Posted 8 February 2023, 10:53 pm EST

    Hello Pedro,

    SpreadJS v16 introduced new sjs formats for storing spreadsheets, as well as new methods on the Workbook class such as workbook.save(), workbook.open(), workbook.import(), and workbook.export().

    You must import the @grapecity/spread-sheets-io module to support these methods. SpreadJS designer v16 requires the @grapecity/spread-sheets-io module to support these new features, which is why it throws an error. Simply include the @grapecity/spread-sheets-io module in your project.

    You could also refer to the attached Angular Sample that uses the Designer Component.

    This module can be imported by running npm install @angular/spread-sheets-io.

    Please let us know if you continue to have problems.

    SpreadJS New File Format Demo: https://www.grapecity.com/spreadjs/demos/features/spreadjs-file-format/overview/purejs

    Regards,

    Ankit

  • Posted 8 February 2023, 10:53 pm EST

    Angular Sample

    angular.zip

  • Posted 9 February 2023, 10:34 am EST

    Thanks, it worked.

    With this new method of importing to excel.

    How do I import a file, keeping my already created tabs?

    Before that was how I coded

    https://www.grapecity.com/forums/spreadjs/import-excel-file-keeping-tabs

  • Posted 10 February 2023, 7:33 am EST

    Hi Pedro,

    In the latest version of SpreadJS, v16, several new methods were added to the Workbook class through the @grapecity/spread-sheets-io package. These methods include save(), open(), import(), and export(), which provide various capabilities for working with spreadsheets. The save() and open() methods allow users to save and load spreadsheets in the sjs format, which has improved performance for larger files. Meanwhile, the import() and export() methods enable users to import and export spreadsheets in formats such as Excel, ssjson, and csv.

    It’s important to note that these methods only load the specified file type onto a workbook instance, they do not merge two spreadsheets. To merge two spreadsheets, you would need to merge their respective json files and then load the merged json onto a workbook instance.

    For your convenience, a sample code has been provided which demonstrates how to merge an imported sjs file with the current spreadsheet. The sample does this by loading the imported sjs file onto a second (hidden) spreadsheet, obtaining its json using the spread.toJSON() method, and finally merging the json of the two spreadsheets before loading the merged data onto the first spreadsheet.

    Sample: https://codesandbox.io/s/solution-forked-zzduhm?file=/src/index.js

    Of course! If you continue to encounter any issues, please don’t hesitate to let me know. I’ll do my best to assist you.

    Regards,

    Ankit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels