Copy a workbook to another

Posted by: bruno.bueno on 12 November 2024, 1:09 pm EST

  • Posted 12 November 2024, 1:09 pm EST - Updated 12 November 2024, 1:14 pm EST

    Hi everyone, hope you are doing fine,

    I need to export a file, but that file has some colluns and some pages that the exported file cannot have, so I first create anothe file by converting my current workbook to JSON, creating another Workbook and using the fromJSON function to load (would be nice if we had a function to do that, converting large files to JSON is not performatic), problem is this fromJSON raises an ‘exception not supported’ when I toogle the rowHeadersAsFrozenColumns, and the file is not exported. If I dont flag that option the file exports normally, and if I try to import and export the file on https://developer.mescius.com/spreadjs/designer/index.html, the exportions goes well.

    This is the code I’m using →

          workbookExcel = new GC.Spread.Sheets.Workbook();
          workbookExcel.fromJSON(
            workbook.toJSON({
              ignoreStyle: excel.semEstilo,
              ignoreFormula: excel.semFormulas,
            })
          );

  • Posted 13 November 2024, 12:57 am EST - Updated 13 November 2024, 1:03 am EST

    Hi,

    Regarding the issue where “fromJSON raises an ‘exception not supported’ when toggling rowHeadersAsFrozenColumns,” I attempted to replicate the behavior with the provided information but couldn’t reproduce the error. On my end, the file exported without exceptions using the fromJSON method. Please see the attached GIF “Steps.gif” and the sample.

    Gif:

    Sample: https://jscodemine.mescius.io/share/cxX0yGLu0kuPJikFfU3s_g/?IsEmbed=false&Theme=Unset&PreviewDirection=0&IsEditorShow=true&IsExplorerShow=true&IsPreviewShow=true&IsConsoleShow=true&IsRunBTNShow=false&IsResetBTNShow=false&IsOpenInCodemineBTNShow=false&PanelWidth=20&PanelWidth=50&PanelWidth=30&defaultOpen={"OpenedFileName"%3A["%2Findex.html"%2C"%2Fsrc%2Fapp.js"]%2C"ActiveFile"%3A"%2Fsrc%2Fapp.js"}

    If you are using an older version, please check with the latest version, 17.1.9. If the issue persists, To better assist you, could you share a minimal working sample along with the steps to replicate the behavior you have observed, or modify the existing sample to replicate the behavior? This will enable me to investigate the problem more thoroughly. Additionally, It would be helpful if you could provide a GIF or video illustrating the issue.

    Regarding the performance issue when converting large files to JSON, could you share a sample file where you’ve observed this? If the file contains sensitive information, feel free to replace it with dummy data or you could create a private ticket.

    Regards,

    Priyam

Need extra support?

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

Learn More

Forum Channels