Issue with Reopening SpreadJS .sjs Files

Posted by: bruno.bueno on 5 October 2023, 4:22 am EST

    • Post Options:
    • Link

    Posted 5 October 2023, 4:22 am EST

    I’m currently working on an Angular project that utilizes SpreadJS, and I’ve encountered an issue when saving and reopening .sjs files. Here’s a brief overview of the problem:

    Initially, I create a .sjs file and save it successfully within my application. When I open the saved file, everything works perfectly, and the content loads as expected.

    However, if I save the same file again and then attempt to reopen it, the file fails to open. Even when I try to open it in the SpreadJS Designer (https://www.grapecity.com/spreadjs/designer/index.html), I receive an “incorrect file format” error.

    This discrepancy between the first saved file and the subsequent ones is puzzling, and I’m not sure what could be causing it. I have checked for any changes or corruptions in the file format but have not been able to identify the root cause.

    I’m reaching out to this forum in the hopes that someone might have encountered a similar issue or have insights into why this might be happening. Any suggestions, tips, or explanations would be greatly appreciated.

    Thank you for your time and assistance!

    Best regards,

    Bruno Santos

  • Posted 5 October 2023, 11:08 pm EST

    Hi,

    We are not able to replicate the issue on our end. We tried to replicate the issue by saving the spreadsheet to an SJS format file and importing the SJS format file again(3-4 times). However, we did not encounter any issues.

    Could you please provide us with a sample that replicates the issue? It will be really helpful in the investigation of the issue. You may modify the attached sample to replicate the issue and share it with us.

    sample: spread-angular.zip

    Regards,

    Chandan

  • Posted 5 October 2023, 11:47 pm EST

    Hello Chandan,

    Thank you for your prompt response and your willingness to assist with the issue I’m facing. I appreciate your efforts in trying to replicate the problem on your end.

    I understand the request for a sample that replicates the issue, but unfortunately, I cannot share the client’s file due to confidentiality and privacy concerns. I apologize for any inconvenience this may cause.

    In our local tests as well, we have not been able to reproduce the issue consistently. However, we did notice that after each save operation, the file size seems to change, which adds to the mystery of this problem.

    Since I cannot provide a sample file, I’m open to any suggestions or insights you might have regarding why the file size is changing after each save, which could be related to the issue I’m experiencing. Any guidance or troubleshooting steps to help pinpoint the root cause would be greatly appreciated.

    Thank you once again for your assistance.

    Best regards,

    Bruno Santos

  • Posted 6 October 2023, 4:18 am EST

    Hello Chandan,

    I extracted the .sjs files and edited, now I need to convert them back to the .sjs, how can i do that? If there is a way to directly edit the .sjs let me know!

    Best regards,

    Bruno Santos

  • Posted 6 October 2023, 5:16 am EST

    Hello Chandan,

    Here is the .zip file, I could not convert it to .sjs

    Best regards,

    Bruno Santo

    send_grapecity_test.zip

  • Posted 8 October 2023, 9:19 pm EST

    Hi Bruno,

    Apologies for the delayed response.

    Please provide us with a minimal sample replicating the issue or the SJS file in which you are experiencing the issue. Without a sample, it would be difficult to pinpoint the actual cause of the issue as it might be file-specific as well.

    If the data of the SJS file is confidential then you could create a support ticket from https://www.grapecity.com/my-account/my-support. The created ticket will not be public as the forum threads are. Also, you can view/manage the created tickets in your GrapeCity account.

    It is important to note that the SJS format of SpreadJS is simply a zipped folder. So after extracting an SJS format file and making changes to the extracted files, you can simply compress the files in zip format and it should work(can be imported in SpreadJS as an SJS file).

    However, it is not recommended to directly change the SJS file as it may cause some unknown issues. Also, the implementation/structure of the SJS format may be changed in the future to introduce new features and optimizations.

    Please let us know if you face any issues.

    Regards,

    Chandan

  • Posted 9 October 2023, 4:18 am EST

    Hello Chandan,

    Here is the .zip file.

    Best regards,

    Bruno Santos

    0910.zip

  • Posted 9 October 2023, 11:02 pm EST

    Hi Bruno,

    Could you please provide us with the SJS file that can be imported correctly into SpreadJS? The zip file of SJS file that you shared with us, can not be imported into SpreadJS and because of that we can not properly investigate the issue on our end.

    We would need the SJS file to investigate and anylize why the same SJS file can not be imported again. It would be difficult to comment on the nature and cause of the issue without replicating the issue on our end.

    If the data of the SJS file is confidential then you could create a support ticket from https://www.grapecity.com/my-account/my-support as I mentioned in previous response.

    Regards,

    Chandan

  • Posted 10 October 2023, 12:25 am EST

    Hello Chandan,

    Here is the working .zip file.

    Best regards,

    Bruno Santos

    safe.zip

  • Posted 11 October 2023, 4:45 am EST

    Hello Chandan,

    In our further investigation, we discovered that some of the tabs within the .sjs files lost their indexes during the saving process. By removing the code that caused this issue, we were able to successfully open the file.

    Additionally, in some cases, we were able to solve the problem by importing the .sjs files into the Spread Desktop application, saving them as SSJSON, and then exporting them back to the .sjs format. This method seemed to refresh the file structure and resolve any potential formatting or compatibility issues.

    If you have any further tips or advice on working with .sjs files in SpreadJS, please feel free to share them. Your expertise is truly appreciated.

    Thank you once again for your support!

    Best regards,

    Bruno Santos

  • Posted 11 October 2023, 9:49 pm EST

    Hi Bruno,

    It seems that the issue you were experiencing has been resolved. If you continue to face the issue, please let us know.

    Please note that sharing the minimal working sample(replicating the issue) or file causing the issue is always appreciated as it helps us to replicate the issue on our end and we can also investigate the issue more thoroughly.

    It is always recommended to use the SpreadJS APIs to achieve the desired behavior instead of directly modifying the SSJSON and SJS files as it may break their defined structure causing issues. Also, since SSJSON and SJS formats are specific to SpreadJS, they may be changed in the future for performance improvements and optimizations. So, it is good to rely only on the SpreadJS APIs.

    You may refer to https://www.grapecity.com/spreadjs/docs/features/spreadjs-file-format#site_main_content-doc-content_title and https://www.grapecity.com/spreadjs/docs/overview to learn more about SJS file format and best practices in SpreadJS.

    Regards

Need extra support?

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

Learn More

Forum Channels